AI-powered news posting for X (Twitter)
Project description
๐ฐ newsbot
News in. AI in the middle. Posts out.
A lightweight Python package that automatically turns news into AI-generated posts for X (Twitter).
Everything that makes your bot uniqueโits personality, news sources, schedule, prompts, and API keysโlives in a single manifest.yaml.
from newsbot import XBot
bot = XBot("manifest.yaml")
bot.run()
That's it.
newsbot loads your manifest, fetches the latest headlines, generates content using your preferred LLM, and publishes directly to X.
No boilerplate. No frameworks. No GitHub Actions.
Run it anywhere Python runs:
- Cron jobs
- Flask / FastAPI
- AWS Lambda
- Discord bots
- Background workers
- Your own scripts
โจ Why newsbot?
Most AI news bots are a collection of scripts that you fork and customize for every account.
newsbot takes a different approach.
The package stays the same.
Everything account-specific lives inside a single manifest.yaml.
That means you can run:
- One package
- Ten manifests
- Ten completely different bots
without changing a single line of Python.
๐ Managed Hosting Plans
Don't want to manage servers, scheduling, monitoring, or prompt tuning?
Pick a plan and I'll take care of everything.
| Feature | ๐ |
๐ผ |
๐ข |
|---|---|---|---|
| Managed Hosting | โ | โ | โ |
| Automatic Updates | โ | โ | โ |
| Scheduled Posting | โ | โ | โ |
| Gemini AI Integration | โ | โ | โ |
| Live Email Report | โ | โ | โ |
| AI Image Generation | โ | โ | โ |
| Fully Customized Bot Logic | โ | โ | โ |
| Dedicated Support & Consulting | โ | โ | โ |
| Prompt Optimization | โ | Basic | Advanced |
Pricing
| Plan | Price |
|---|---|
| ๐ STARTER | $20/month |
| ๐ผ PROFESSIONAL | $40/month |
| ๐ข ENTERPRISE | $150 setup + $40/month |
Notes
- You provide your own X API credentials.
- Gemini usage is currently free.
- X API charges (if applicable) are billed directly by X.
๐ฆ Installation
Install from PyPI:
pip install newsbot
Or install from source:
git clone git@github.com:OmidAlekasir/newsbot.git
cd newsbot
pip install -e .
๐ Quick Start
1. Copy the example manifest
Copy:
manifest.example.yaml
to:
manifest.yaml
Then configure:
- X API credentials
- AI provider credentials
- RSS feeds
- Prompt configuration
API keys can also be loaded from environment variables:
api_key: ${GEMINI_API_KEY}
2. Create your prompts
Place prompt files inside:
prompts/
Each prompt should include:
{{news_context}}
This placeholder is automatically replaced with the latest news before generation.
3. Run your bot
from newsbot import XBot
bot = XBot("manifest.yaml")
bot.run()
Preview posts without publishing:
bot.run(dry_run=True)
โ Support the Project
If newsbot saves you time or powers your projects, consider supporting future development.
EVM Address
0x78f8b8e93174Ba5D6C0D24218219e23f014E98a9
Every contribution helps improve the project โค๏ธ
๐ Running Multiple Bots
Each bot has its own manifest.
from newsbot import XBot
morning_bot = XBot("bots/morning/manifest.yaml")
crypto_bot = XBot("bots/crypto/manifest.yaml")
morning_bot.run(prompt_key="morning_flash")
crypto_bot.run()
One package.
Different personalities.
Different news sources.
Different X accounts.
๐ป CLI
Run your bot directly from the terminal.
List available prompts:
python -m newsbot.cli --list-prompts
Preview without posting:
python -m newsbot.cli --dry-run
Use a specific prompt:
python -m newsbot.cli -p contrarian_view
๐ง Manifest Overview
Everything is configured inside one file.
| Section | Description |
|---|---|
twitter |
X API credentials |
ai |
AI provider, models, and fallback models |
news |
RSS feeds, article limits, filters, and media options |
prompts |
Prompt templates, personalities, and schedules |
run |
Runtime settings such as dry_run |
Need a new personality?
Add a prompt.
Need more news sources?
Add RSS feeds.
Want to try another LLM?
Change the model.
No Python code needs to change.
๐ฏ Great For
- Personal brands
- AI news accounts
- Crypto bots
- Finance commentary
- Sports updates
- Tech news
- Marketing experiments
- Multi-account operators
- SaaS integrations
- Internal automation
๐ Project Structure
newsbot/
โโโ __init__.py
โโโ core.py
โโโ config.py
โโโ ai_client.py
โโโ news_fetcher.py
โโโ twitter_client.py
โโโ cli.py
โโโ logger.py
โโโ utils.py
manifest.example.yaml
prompts/
๐ License
MIT License.
Use it.
Modify it.
Ship it.
Built with โค๏ธ using Python, RSS, Gemini, and the X API.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file newsbot-1.0.0-py3-none-any.whl.
File metadata
- Download URL: newsbot-1.0.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f27846cad5f31fe535e4f5d8af199acffdff2979b97b757d0480ce7ea7680bff
|
|
| MD5 |
74ba39ac62bb17d4bd96fbad9a7b75ca
|
|
| BLAKE2b-256 |
011cdf9ea85fe60b83c9586d9eb4cb55da997e03dea6c0770ddf5b57bb586578
|