Skip to main content

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.

๐Ÿ“ง 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.

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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

newsbot-1.0.0-py3-none-any.whl (18.1 kB view details)

Uploaded Python 3

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

Hashes for newsbot-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f27846cad5f31fe535e4f5d8af199acffdff2979b97b757d0480ce7ea7680bff
MD5 74ba39ac62bb17d4bd96fbad9a7b75ca
BLAKE2b-256 011cdf9ea85fe60b83c9586d9eb4cb55da997e03dea6c0770ddf5b57bb586578

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page