Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📰 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.

📧 majid.alekasir@gmail.com


📦 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.

About

A package for automated posting on X platform (Twitter), powered by free Gemini LLM models.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages