Skip to main content

Command Palette

Search for a command to run...

Build a Fully Automated Twitter/X News Bot That Posts 5 Times a Day — For Free (No Server Needed)

Create your own Twitter bot that automatically tweets breaking tech, cybersecurity, science, and world news using RSS feeds and GitHub Actions. 100% free, written in Go, with support for AI-generated memes.

Updated
4 min readView as Markdown
Build a Fully Automated Twitter/X News Bot That Posts 5 Times a Day — For Free (No Server Needed)

Introduction

Tired of manually sharing tech news on Twitter/X? Want a bot that delivers high-quality content to your followers while you sleep?

Meet twitter_bot by jvcByte — a powerful, open-source automated Twitter/X bot that monitors hundreds of RSS feeds and posts fresh articles 5 times a day completely for free using GitHub Actions.

No servers, no paid hosting, no complex infrastructure. Just fork, configure, and let it run.

Link to repo: https://github.com/jvcByte/twitter_bot

What Does This Bot Actually Do?

Every 6 hours, the bot:

  • Polls up to 290 RSS feeds across 9 categories (World, Tech, Cybersecurity, Business, Science, Environment, Health, Space, and Africa)

  • Detects new articles that haven't been tweeted yet

  • Posts them automatically with article thumbnails when available

  • Never repeats the same article (smart deduplication using seen_articles.json)

It also supports a tech-only feed set with 143 high-quality sources.

Post Modes Available:

  • news — Pure news articles with images (default)

  • meme — AI-generated humorous tech posts with funny meme images

  • mixed — News articles + one AI meme per run

Cool Features

  • Multi-account support — Run different bots for different Twitter accounts (e.g., one general news, one tech-focused)

  • AI-powered humor — Uses Groq to generate dev jokes, hot takes, polls, and relatable tech observations

  • Meme images — Automatically generates memes using Imgflip templates (Drake, Distracted Boyfriend, Expanding Brain, etc.)

  • Category filtering — Focus on just cybersecurity, science, or any specific topic

  • Serverless — Powered entirely by GitHub Actions cron jobs

  • Built in Go — Fast, lightweight, and reliable

Tech Stack

  • Language: Go

  • Twitter/X Login: Uses real browser cookies (more reliable than API keys for bot-like behavior)

  • RSS Parsing: Standard Go RSS parser

  • AI Content: Groq API

  • Meme Generation: Imgflip API

  • Scheduling: GitHub Actions

  • Browser Automation: Headless Chrome (for login)

How to Set It Up (Step-by-Step)

  1. Fork the Repository
    Go to the repo and click Fork.

  2. Export Your Twitter Cookies

    • Log into x.com in Chrome or Firefox

    • Install the Cookie-Editor extension

    • Export cookies as JSON (single line, no quotes)

  3. Add GitHub Secrets
    In your forked repo → Settings → Secrets and variables → Actions → Secrets
    Add:

    • TWITTER_USERNAME

    • TWITTER_PASSWORD

    • TWITTER_COOKIES

    • GROQ_API_KEY (free from console.groq.com)

    • IMGFLIP_USERNAME and IMGFLIP_PASSWORD (for memes)

    You can also set up a second tech account using TECH_TWITTER_* secrets.

  4. Configure Variables
    Add repository variables like:

    • POST_MODEnews, meme, or mixed

    • MAX_TWEETS_PER_RUN5 (recommended)

    • TWEET_DELAY_SECONDS90

  5. Enable GitHub Actions
    Go to the Actions tab and enable the workflows.
    They will now run automatically every 6 hours.

You can also run it locally with go run . after setting up a .env file.

Pro Tips

  • Start with POST_MODE=news and MAX_TWEETS_PER_RUN=5 to avoid rate limits.

  • Use the post_tech.yml workflow for a dedicated tech + meme account.

  • If login fails, re-export cookies — Twitter sessions expire.

  • Debug failures easily — GitHub Actions saves screenshots as artifacts when something breaks.

Who Is This For?

  • Tech enthusiasts who want to grow their Twitter presence

  • Developers building personal brands

  • News aggregators or niche topic accounts

  • Anyone who loves automation and hates manual posting

Final Thoughts

This project is a perfect example of how powerful GitHub Actions can be for building real-world automation tools. With just a few minutes of setup, you get a 24/7 news bot that feels almost human — especially in mixed mode with AI humor and memes.

Whether you want to share breaking tech news, cybersecurity alerts, or just make developers laugh, this bot has you covered.

Star the repo if you find it useful: jvcByte/twitter_bot

Have you built any Twitter bots before? Or planning to try this one? Drop your thoughts in the comments!