Skip to content

lpsmurf/twitter-guide-dashboard

Repository files navigation

Twitter → Guide Preview Dashboard

Interactive web interface for reviewing, editing, and deploying the Twitter → Claude → HTML guide pipeline.

Features

  • Real-time tweet display - Shows all fetched Twitter bookmarks
  • Claude categorization preview - See how Claude will categorize each tweet
  • Interactive editing - Edit summaries, categories, and URLs before deployment
  • Flexible control - Add/remove tweets from the guide, reorganize categories
  • HTML preview - Live preview of the final guide before deployment
  • One-click deployment - Commits to GitHub and deploys to production

Installation

cd /home/clawd/.local/opt/twitter_guide_dashboard

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

Configuration

The dashboard uses the same configuration as the main Twitter guide pipeline:

  • Config file: /etc/twitter_guide/config.json

Required config keys:

  • twitter_bearer_token - Twitter API v2 bearer token
  • claude_api_key - Claude API key
  • twitter_username - Twitter username to fetch bookmarks from

Running the Dashboard

# Activate virtual environment
source venv/bin/activate

# Run the Flask server
python3 app.py

# Or specify a custom port
DASHBOARD_PORT=3004 python3 app.py

The dashboard will be available at:

  • http://localhost:3004 (local)
  • http://<IRIS_VPS_IP>:3004 (remote)

Usage

1. Refresh Tweets

Click the "↻ Refresh" button to fetch fresh tweets from your Twitter bookmarks and process them through Claude for categorization.

2. Review Entries

Browse through all tweets organized by category (OpenClaw, Claude, Infrastructure, Other). Each entry shows:

  • Summary/description
  • Author and date
  • Category label
  • Link to original tweet

3. Edit Entries

Click the "✎" button on any entry to:

  • Edit the summary text
  • Change the category
  • Update the URL

4. Control Inclusion

Use the checkbox on each entry to include/exclude it from the final guide. Use the "Select All" / "Deselect All" buttons for bulk operations.

5. Preview HTML

Click "👁️ Preview HTML" to see exactly how the final guide will look in a modal.

6. Deploy

Once satisfied with the review and edits:

  1. Click "🚀 Deploy Guide"
  2. Confirm the deployment
  3. The dashboard will:
    • Generate the final HTML
    • Commit changes to GitHub
    • Push to production

API Endpoints

  • GET /api/state - Get current dashboard state
  • POST /api/refresh - Fetch tweets and process through Claude
  • PUT /api/entry/<tweet_id> - Update an entry
  • POST /api/entries/reorder - Reorder entries
  • GET /api/preview - Generate HTML preview
  • POST /api/deploy - Generate, commit, and deploy

State Management

Dashboard state is persisted to:

~/.twitter_guide_dashboard_state.json

This includes:

  • All entries (tweets + Claude processing results)
  • User modifications (edits, inclusions, order)
  • Last update timestamp

Integration with Main Pipeline

This dashboard operates alongside the main twitter_guide.py pipeline:

  • Main pipeline (twitter_guide.py): Automated weekly refresh on Sundays at 10:00 UTC
  • Dashboard (app.py): Interactive manual control for L P to review and refine

Both use the same:

  • Configuration file
  • Claude API for categorization
  • Output file (~/hfspweb-prod/guide.html)
  • Git repository

Systemd Service (Optional)

To run the dashboard as a systemd service:

[Unit]
Description=Twitter Guide Dashboard
After=network.target

[Service]
Type=simple
User=clawd
WorkingDirectory=/home/clawd/.local/opt/twitter_guide_dashboard
ExecStart=/home/clawd/.local/opt/twitter_guide_dashboard/venv/bin/python app.py
Restart=always
RestartSec=10
Environment="DASHBOARD_PORT=3004"

[Install]
WantedBy=multi-user.target

Install:

sudo cp twitter_guide_dashboard.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now twitter_guide_dashboard

Logging

Logs are output to stdout. When running as a systemd service, use:

journalctl -u twitter_guide_dashboard -f

Troubleshooting

Config not found

Make sure /etc/twitter_guide/config.json exists and is readable.

Twitter API errors

Verify the bearer token is valid and hasn't expired.

Claude API errors

Check that the API key is valid and has sufficient quota.

Port already in use

Specify a different port:

DASHBOARD_PORT=3005 python3 app.py

Development Notes

The dashboard is built with:

  • Backend: Flask (Python)
  • Frontend: Vanilla HTML/CSS/JS (no frameworks)
  • Styling: Custom dark theme matching the guide design

All client-side code is in templates/index.html. The backend API is in app.py.

No build step required—just serve and go.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors