This site uses GitHub Actions to automatically fetch your Twitter posts and display them alongside your blog posts, Substack articles, and LinkedIn posts.
Prerequisites
- A Twitter API Bearer Token (you mentioned you have this)
- Access to your GitHub repository settings
Setup Instructions
- Go to your GitHub repository: https://github.com/jbdamask/jbdamask.github.io
- Click on Settings (top navigation)
- In the left sidebar, click Secrets and variables → Actions
- Click the New repository secret button
- Add your secret:
- Name:
TWITTER_BEARER_TOKEN
- Value: Paste your Twitter API Bearer Token
- Click Add secret
Step 2: Manually Trigger the Workflow (First Run)
Since the workflow is scheduled to run daily at 6 AM UTC, you can trigger it manually for the first time:
- Go to the Actions tab in your repository
- Click on Fetch Twitter Posts in the left sidebar
- Click the Run workflow button (on the right)
- Click the green Run workflow button in the dropdown
- Wait for the workflow to complete (usually takes ~30 seconds)
Step 3: Verify It Works
After the workflow completes:
- Check if
_data/twitter-posts.yml was created in your repository
- Visit your site at https://jbdamask.github.io/posts/
- You should see your recent tweets displayed with the Twitter badge
How It Works
Automated Daily Updates
- The workflow runs automatically every day at 6 AM UTC
- It fetches your 10 most recent tweets (excluding retweets and replies)
- Tweets are saved to
_data/twitter-posts.yml
- The site rebuilds and displays the updated tweets
Manual Updates
You can manually trigger the workflow anytime from the Actions tab if you want to update your tweets immediately.
What Gets Fetched
- Only your original tweets (no retweets or replies)
- Last 10 tweets
- Tweet text, link, date, and images (if available)
Files Created
.github/workflows/fetch-twitter.yml - GitHub Actions workflow
scripts/fetch_twitter.py - Python script that fetches tweets
_data/twitter-posts.yml - Generated file with your tweets (auto-created on first run)
Troubleshooting
Workflow fails with authentication error
- Check that your
TWITTER_BEARER_TOKEN secret is set correctly
- Verify your Twitter API key is still valid
- Check the Actions tab to see if the workflow ran successfully
- Verify
_data/twitter-posts.yml exists and has content
- Check browser console for JavaScript errors
- The workflow runs daily at 6 AM UTC
- Manually trigger it from the Actions tab for immediate updates
The integration uses the Twitter API v2 endpoint:
- Endpoint:
GET /2/users/:id/tweets
- Required scopes: Read tweets
- Free tier supported (if you have the Bearer Token, it should work)
Need Help?
If you encounter issues, check:
- GitHub Actions logs in the Actions tab
- The
_data/twitter-posts.yml file to see if tweets were fetched
- Browser console for JavaScript errors when viewing the site