Built a Tweet Bot that posts your thoughts on Current News
I wanted a simple bot that could post tweets regularly without me having to babysit it. The first version was straightforward: pick a topic, pick a tone, ask Ollama/Gemma4 to write a tweet, post it to X, log it, and send me a log of the successful post on Telegram.
That worked, but it had one clear gap. The tweets were topic-based, not context-aware. If the topic was AI, cricket, or SaaS, the bot could write something reasonable, but it was not grounded in what was happening today.
So I added a news step.
The bot now picks a topic from my configured list and checks Google News RSS for recent US-English news on that topic. If it finds a usable article from the last 48 hours, it extracts the title, source, published time, link, and a short snippet. That becomes context for Ollama. The prompt is still constrained: short tweet, selected tone, no hashtags, no invented facts, no article URL.
If no current news is found, the bot does not fail. It falls back to the earlier generic topic-based flow and still posts. That was important to me because automation should be reliable. A news feed issue should not stop the whole system.
The flow now looks like this:
Pick a topic
Fetch recent news for that topic
Pick a tone
Ask Ollama to write a tweet using that context
Validate the tweet
Post to X by appending #botWrites for clear bot labeling
Log the post
Send a short Telegram update
I also wanted the bot to be easy to operate. So the configuration lives outside the code. GitHub repository variables control things like topics, tones, schedule, model, news settings, and retry limits. Secrets hold the sensitive values like X, Ollama, and Telegram credentials.
The bot runs through GitHub Actions four times a day. Each successful post updates a tweet history file on GitHub. The bot sends me the useful summary: topic, tone, time taken, number of attempts, news topic and the final tweet text on Telegram. It does not send the full log.
The main thing I learned while building this is that small automations become more useful when they are both current and observable. Current, because the tweet uses fresh news when available. Observable, because I can see what happened, how long it took, what was posted, and whether the news context was used.
This is not a complex system, and that is the point. It is a small, practical workflow: RSS for context, Ollama/Gemma4 for generation, X for publishing, GitHub for scheduling and logs, Telegram for visibility.
For now, that is enough.
All this was made possible through vibe coding on Codex.









