Example applications demonstrating Yougopher's capabilities.
- Create OAuth credentials in the Google Cloud Console
- Enable the YouTube Data API v3 and YouTube Analytics API
- Set environment variables:
export YOUTUBE_CLIENT_ID=your-client-id export YOUTUBE_CLIENT_SECRET=your-client-secret
- Navigate to the example directory
- Run
go run main.go - Open
http://localhost:8080/loginin your browser - Complete the OAuth flow
- The example will connect to your active broadcast (or display analytics)
Directory: chatbot/
Description: A basic live chat bot that responds to commands.
Run:
cd chatbot
go run main.goFeatures:
- OAuth authentication with local callback server
- Automatic broadcast detection
- Message event handling
- SuperChat and membership event logging
Commands:
| Command | Description |
|---|---|
!hello |
Greet the user |
!time |
Show current time |
!help |
List available commands |
Customize: Add new commands in handleCommand()
Directory: modbot/
Description: An auto-moderation bot with spam detection and bad word filtering.
Run:
cd modbot
go run main.goFeatures:
- Bad word filtering with auto-delete and timeout
- Spam detection (messages per minute tracking)
- Role-based permissions (mods and owner bypass filters)
- Ban event logging
Commands:
| Command | Description |
|---|---|
!ban @user |
Permanently ban a user |
!timeout @user |
Timeout a user (5 minutes) |
!unban @user |
Remove a user's ban |
!stats |
Show moderation statistics |
Customize: Edit ModerationConfig for bad words and thresholds
Directory: analytics/
Description: A CLI dashboard displaying channel statistics.
Run:
cd analytics
go run main.goFeatures:
- Channel overview (views, watch time, subscribers)
- Top 10 videos by views
- Daily view trend with ASCII bar chart
- Geographic breakdown by country
- Device type breakdown
Scopes Required:
youtube.readonlyyoutubepartner
Customize: Change date ranges or add more report types in main.go
| Example | Requirements |
|---|---|
| chatbot | Active YouTube live stream |
| modbot | Active live stream + moderator permissions |
| analytics | No live stream required |
Security: Examples do not persist tokens. Store tokens securely in production.