# AI-Journo π€π°
**AI-Journo** is an intelligent, autonomous journalism system that discovers, verifies, summarizes, and posts breaking news on X.com (formerly Twitter). Built with a multi-agent architecture using Selenium automation and powered by Google's Gemini 2.0 Flash model, it specializes in covering geopolitics, conflicts, wars, and other high-impact global events.
[](https://www.python.org/downloads/)
[](https://opensource.org/licenses/MIT)
## β¨ Features
### π **Autonomous News Discovery**
- Monitors trusted news sources (BBC, Reuters, CNN, Al Jazeera, Dawn)
- Scrapes homepages and search results for breaking news
- Tracks trending topics from verified X.com accounts
### π‘οΈ **Intelligent Verification**
- Multi-source cross-referencing for fact-checking
- AI-powered content summarization with Gemini 2.0 Flash
- Filters out speculation and unverified information
### π **Professional Content Creation**
- Generates concise, neutral summaries optimized for social media
- Maintains journalistic standards and objectivity
- Supports image attachments and media handling
### π **Automated X.com Management**
- Selenium-based browser automation for posting
- Cookie-based session management for persistent login
- Account engagement features (following, searching, monitoring)
### π§ **Memory Management**
- Tracks processed stories to avoid duplication
- Maintains context across sessions
- Persistent memory for agent coordination
## ποΈ Architecture
AI-Journo uses a sophisticated multi-agent system with specialized roles:
```
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β MainAgent β β ResearchAgent β β WriterAgent β
β β β β β β
β β’ Orchestrates βββββΊβ β’ News discoveryβββββΊβ β’ Content β
β β’ Memory mgmt β β β’ Verification β β creation β
β β’ Coordination β β β’ Source checks β β β’ Summarization β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β β
βΌ βΌ
βββββββββββββββββββ βββββββββββββββββββ
β XAgent β β Tools Suite β
β β β β
β β’ X.com posting β β β’ Web scraping β
β β’ Account mgmt β β β’ Image handlingβ
β β’ Monitoring β β β’ API calls β
βββββββββββββββββββ βββββββββββββββββββ
```
### π€ **Agent Roles**
- **MainAgent**: Central coordinator managing workflow, memory, and agent communication
- **ResearchAgent**: Discovers and verifies news from trusted sources
- **WriterAgent**: Creates optimized social media content from research summaries
- **XAgent**: Handles all X.com interactions via Selenium automation
## π Quick Start
### Installation
```bash
# Install from PyPI (when published)
pip install xnewsbot
# Or install from source
git clone https://github.com/iPythonezta/AI-Journo.git
cd AI-Journo
pip install -e .
```
### Basic Usage
```python
from xnewsbot import AIJourno
# Initialize with your credentials
journo = AIJourno(
x_username="your_username",
x_password="your_password",
api_key="your_gemini_api_key"
)
# Run a specific task
journo.run("Find and post latest news about Middle East conflicts")
# Monitor breaking news
journo.run("Monitor trending topics and post updates on significant developments")
```
### Environment Setup
1. **Get Gemini API Key**: Visit [Google AI Studio](https://aistudio.google.com/) to get your API key
2. **Install Chrome**: Required for Selenium automation
3. **Create directories**: The system will create `images/` and `cookies/` folders automatically
## π Requirements
- **Python 3.8+**
- **Google Chrome** (for Selenium automation)
- **Gemini API Key** (for AI processing)
### Dependencies
```
smolagents>=0.3.0
litellm>=1.0.0
selenium>=4.0.0
requests>=2.25.0
beautifulsoup4>=4.9.0
undetected_chromedriver>=3.4.0
pillow>=8.0.0
urllib3>=1.26.0
```
## π§ Configuration
### Supported News Sources
- **BBC News** (`https://www.bbc.com/`)
- **Dawn** (`https://www.dawn.com/`)
- **Al Jazeera** (`https://www.aljazeera.com/`)
- **Reuters, CNN** (via web scraping)
### X.com Account Monitoring
The system can monitor trusted accounts for breaking news:
- `@warmonitors`
- `@sentdefender`
- `@jacksonhinkle`
- Custom account lists
## π οΈ Advanced Usage
### Custom Research Tasks
```python
# Research specific topics
journo.run("Research and verify reports about recent developments in Ukraine")
# Monitor specific regions
journo.run("Find breaking news from Middle East sources and create summary post")
```
### Image Handling
```python
# The system automatically handles images
# Images are stored in xnewsbot/images/ directory
# Supports JPEG, PNG formats
# Automatic image attachment to posts
```
### Memory Management
```python
# Memory is automatically managed
# Prevents duplicate story processing
# Maintains context across sessions
# Can be cleared manually if needed
```
## π Project Structure
```
AI-Journo/
βββ xnewsbot/
β βββ __init__.py # Package initialization
β βββ ai_journo.py # Main AIJourno class
β βββ agents.py # Multi-agent system setup
β βββ tools.py # Specialized tools and utilities
β βββ twitterbot.py # Selenium X.com automation
β βββ prompts/ # AI agent prompts
β β βββ main_prompt.txt
β β βββ research_agent_prompt.txt
β β βββ writer_prompt.txt
β β βββ x_agent_prompt.txt
β βββ images/ # Media storage
βββ requirements.txt # Dependencies
βββ setup.py # Package configuration
βββ README.md # This file
```
## π Security & Privacy
- **Local Processing**: All automation runs locally on your machine
- **Credential Management**: Secure session handling with cookie storage
- **Rate Limiting**: Built-in delays to respect platform limits
- **No Data Collection**: No user data is transmitted to external services (except API calls)
## β οΈ Important Notes
### Rate Limiting
The system includes built-in rate limiting to respect:
- X.com API limits and platform policies
- News source scraping guidelines
- Gemini API quotas (5 requests per minute)
### Responsible Use
- **Verify Information**: Always cross-check important news before posting
- **Respect Sources**: Follow news website terms of service
- **Platform Compliance**: Ensure X.com account follows platform guidelines
- **Ethical Journalism**: Maintain objectivity and factual accuracy
### Legal Compliance
- Use only for legitimate journalism and news sharing
- Respect copyright and fair use policies
- Follow local laws regarding automated social media activity
## π License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
## π Support
For support, questions, or feature requests:
- **Issues**: [GitHub Issues](https://github.com/iPythonezta/AI-Journo/issues)
- **Discussions**: [GitHub Discussions](https://github.com/iPythonezta/AI-Journo/discussions)
---
**β‘ Built for the future of automated journalism - AI-Journo helps you stay informed and share breaking news responsibly.**
Raw data
{
"_id": null,
"home_page": null,
"name": "xnewsbot",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "twitter x automation bot selenium ai news research",
"author": "Huzaifa Azhar",
"author_email": "huzaifablogger.contact@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/00/b9/11b6f91afc680afe692de120f697832787ff20a429fb8677e539a9c59748/xnewsbot-0.6.0.tar.gz",
"platform": null,
"description": "# AI-Journo \ud83e\udd16\ud83d\udcf0\r\n\r\n**AI-Journo** is an intelligent, autonomous journalism system that discovers, verifies, summarizes, and posts breaking news on X.com (formerly Twitter). Built with a multi-agent architecture using Selenium automation and powered by Google's Gemini 2.0 Flash model, it specializes in covering geopolitics, conflicts, wars, and other high-impact global events.\r\n\r\n[](https://www.python.org/downloads/)\r\n[](https://opensource.org/licenses/MIT)\r\n\r\n## \u2728 Features\r\n\r\n### \ud83d\udd0d **Autonomous News Discovery**\r\n- Monitors trusted news sources (BBC, Reuters, CNN, Al Jazeera, Dawn)\r\n- Scrapes homepages and search results for breaking news\r\n- Tracks trending topics from verified X.com accounts\r\n\r\n### \ud83d\udee1\ufe0f **Intelligent Verification**\r\n- Multi-source cross-referencing for fact-checking\r\n- AI-powered content summarization with Gemini 2.0 Flash\r\n- Filters out speculation and unverified information\r\n\r\n### \ud83d\udcdd **Professional Content Creation**\r\n- Generates concise, neutral summaries optimized for social media\r\n- Maintains journalistic standards and objectivity\r\n- Supports image attachments and media handling\r\n\r\n### \ud83d\ude80 **Automated X.com Management**\r\n- Selenium-based browser automation for posting\r\n- Cookie-based session management for persistent login\r\n- Account engagement features (following, searching, monitoring)\r\n\r\n### \ud83e\udde0 **Memory Management**\r\n- Tracks processed stories to avoid duplication\r\n- Maintains context across sessions\r\n- Persistent memory for agent coordination\r\n\r\n## \ud83c\udfd7\ufe0f Architecture\r\n\r\nAI-Journo uses a sophisticated multi-agent system with specialized roles:\r\n\r\n```\r\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n\u2502 MainAgent \u2502 \u2502 ResearchAgent \u2502 \u2502 WriterAgent \u2502\r\n\u2502 \u2502 \u2502 \u2502 \u2502 \u2502\r\n\u2502 \u2022 Orchestrates \u2502\u25c4\u2500\u2500\u25ba\u2502 \u2022 News discovery\u2502\u25c4\u2500\u2500\u25ba\u2502 \u2022 Content \u2502\r\n\u2502 \u2022 Memory mgmt \u2502 \u2502 \u2022 Verification \u2502 \u2502 creation \u2502\r\n\u2502 \u2022 Coordination \u2502 \u2502 \u2022 Source checks \u2502 \u2502 \u2022 Summarization \u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n \u2502 \u2502\r\n \u25bc \u25bc\r\n\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510 \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\r\n\u2502 XAgent \u2502 \u2502 Tools Suite \u2502\r\n\u2502 \u2502 \u2502 \u2502\r\n\u2502 \u2022 X.com posting \u2502 \u2502 \u2022 Web scraping \u2502\r\n\u2502 \u2022 Account mgmt \u2502 \u2502 \u2022 Image handling\u2502\r\n\u2502 \u2022 Monitoring \u2502 \u2502 \u2022 API calls \u2502\r\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\r\n```\r\n\r\n### \ud83e\udd16 **Agent Roles**\r\n\r\n- **MainAgent**: Central coordinator managing workflow, memory, and agent communication\r\n- **ResearchAgent**: Discovers and verifies news from trusted sources\r\n- **WriterAgent**: Creates optimized social media content from research summaries \r\n- **XAgent**: Handles all X.com interactions via Selenium automation\r\n\r\n## \ud83d\ude80 Quick Start\r\n\r\n### Installation\r\n\r\n```bash\r\n# Install from PyPI (when published)\r\npip install xnewsbot\r\n\r\n# Or install from source\r\ngit clone https://github.com/iPythonezta/AI-Journo.git\r\ncd AI-Journo\r\npip install -e .\r\n```\r\n\r\n### Basic Usage\r\n\r\n```python\r\nfrom xnewsbot import AIJourno\r\n\r\n# Initialize with your credentials\r\njourno = AIJourno(\r\n x_username=\"your_username\",\r\n x_password=\"your_password\", \r\n api_key=\"your_gemini_api_key\"\r\n)\r\n\r\n# Run a specific task\r\njourno.run(\"Find and post latest news about Middle East conflicts\")\r\n\r\n# Monitor breaking news\r\njourno.run(\"Monitor trending topics and post updates on significant developments\")\r\n```\r\n\r\n### Environment Setup\r\n\r\n1. **Get Gemini API Key**: Visit [Google AI Studio](https://aistudio.google.com/) to get your API key\r\n2. **Install Chrome**: Required for Selenium automation\r\n3. **Create directories**: The system will create `images/` and `cookies/` folders automatically\r\n\r\n## \ud83d\udccb Requirements\r\n\r\n- **Python 3.8+**\r\n- **Google Chrome** (for Selenium automation)\r\n- **Gemini API Key** (for AI processing)\r\n\r\n### Dependencies\r\n\r\n```\r\nsmolagents>=0.3.0\r\nlitellm>=1.0.0 \r\nselenium>=4.0.0\r\nrequests>=2.25.0\r\nbeautifulsoup4>=4.9.0\r\nundetected_chromedriver>=3.4.0\r\npillow>=8.0.0\r\nurllib3>=1.26.0\r\n```\r\n\r\n## \ud83d\udd27 Configuration\r\n\r\n### Supported News Sources\r\n\r\n- **BBC News** (`https://www.bbc.com/`)\r\n- **Dawn** (`https://www.dawn.com/`)\r\n- **Al Jazeera** (`https://www.aljazeera.com/`)\r\n- **Reuters, CNN** (via web scraping)\r\n\r\n### X.com Account Monitoring\r\n\r\nThe system can monitor trusted accounts for breaking news:\r\n- `@warmonitors`\r\n- `@sentdefender` \r\n- `@jacksonhinkle`\r\n- Custom account lists\r\n\r\n## \ud83d\udee0\ufe0f Advanced Usage\r\n\r\n### Custom Research Tasks\r\n\r\n```python\r\n# Research specific topics\r\njourno.run(\"Research and verify reports about recent developments in Ukraine\")\r\n\r\n# Monitor specific regions\r\njourno.run(\"Find breaking news from Middle East sources and create summary post\")\r\n```\r\n\r\n### Image Handling\r\n\r\n```python\r\n# The system automatically handles images\r\n# Images are stored in xnewsbot/images/ directory\r\n# Supports JPEG, PNG formats\r\n# Automatic image attachment to posts\r\n```\r\n\r\n### Memory Management\r\n\r\n```python\r\n# Memory is automatically managed\r\n# Prevents duplicate story processing\r\n# Maintains context across sessions\r\n# Can be cleared manually if needed\r\n```\r\n\r\n## \ud83d\udcc1 Project Structure\r\n\r\n```\r\nAI-Journo/\r\n\u251c\u2500\u2500 xnewsbot/\r\n\u2502 \u251c\u2500\u2500 __init__.py # Package initialization\r\n\u2502 \u251c\u2500\u2500 ai_journo.py # Main AIJourno class\r\n\u2502 \u251c\u2500\u2500 agents.py # Multi-agent system setup\r\n\u2502 \u251c\u2500\u2500 tools.py # Specialized tools and utilities\r\n\u2502 \u251c\u2500\u2500 twitterbot.py # Selenium X.com automation\r\n\u2502 \u251c\u2500\u2500 prompts/ # AI agent prompts\r\n\u2502 \u2502 \u251c\u2500\u2500 main_prompt.txt\r\n\u2502 \u2502 \u251c\u2500\u2500 research_agent_prompt.txt\r\n\u2502 \u2502 \u251c\u2500\u2500 writer_prompt.txt\r\n\u2502 \u2502 \u2514\u2500\u2500 x_agent_prompt.txt\r\n\u2502 \u2514\u2500\u2500 images/ # Media storage\r\n\u251c\u2500\u2500 requirements.txt # Dependencies\r\n\u251c\u2500\u2500 setup.py # Package configuration\r\n\u2514\u2500\u2500 README.md # This file\r\n```\r\n\r\n## \ud83d\udd12 Security & Privacy\r\n\r\n- **Local Processing**: All automation runs locally on your machine\r\n- **Credential Management**: Secure session handling with cookie storage\r\n- **Rate Limiting**: Built-in delays to respect platform limits\r\n- **No Data Collection**: No user data is transmitted to external services (except API calls)\r\n\r\n## \u26a0\ufe0f Important Notes\r\n\r\n### Rate Limiting\r\nThe system includes built-in rate limiting to respect:\r\n- X.com API limits and platform policies\r\n- News source scraping guidelines \r\n- Gemini API quotas (5 requests per minute)\r\n\r\n### Responsible Use\r\n- **Verify Information**: Always cross-check important news before posting\r\n- **Respect Sources**: Follow news website terms of service\r\n- **Platform Compliance**: Ensure X.com account follows platform guidelines\r\n- **Ethical Journalism**: Maintain objectivity and factual accuracy\r\n\r\n### Legal Compliance\r\n- Use only for legitimate journalism and news sharing\r\n- Respect copyright and fair use policies\r\n- Follow local laws regarding automated social media activity\r\n\r\n## \ud83d\udcdc License\r\n\r\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\r\n\r\n## \ud83c\udd98 Support\r\n\r\nFor support, questions, or feature requests:\r\n- **Issues**: [GitHub Issues](https://github.com/iPythonezta/AI-Journo/issues)\r\n- **Discussions**: [GitHub Discussions](https://github.com/iPythonezta/AI-Journo/discussions)\r\n---\r\n\r\n**\u26a1 Built for the future of automated journalism - AI-Journo helps you stay informed and share breaking news responsibly.**\r\n",
"bugtrack_url": null,
"license": null,
"summary": "AI-powered news bot for X.com (Twitter) automation with research and writing capabilities.",
"version": "0.6.0",
"project_urls": null,
"split_keywords": [
"twitter",
"x",
"automation",
"bot",
"selenium",
"ai",
"news",
"research"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "71dd97dd1a06a80c9f0e539e627bde6955f721f64644127e8b61009208762df8",
"md5": "611d0b65978bf7e7167ddbcedd211933",
"sha256": "39e1a346675632358cf1c808083c24565a41a14c38396da60ada58cd83744495"
},
"downloads": -1,
"filename": "xnewsbot-0.6.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "611d0b65978bf7e7167ddbcedd211933",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 108570,
"upload_time": "2025-07-19T06:36:12",
"upload_time_iso_8601": "2025-07-19T06:36:12.050871Z",
"url": "https://files.pythonhosted.org/packages/71/dd/97dd1a06a80c9f0e539e627bde6955f721f64644127e8b61009208762df8/xnewsbot-0.6.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "00b911b6f91afc680afe692de120f697832787ff20a429fb8677e539a9c59748",
"md5": "127c333a65f6754678ee26d1975367e1",
"sha256": "4113146e80da9bbc5bdb9edd1d17d3e1d1a1483eb0d05873d8f006b8f4e6c2cb"
},
"downloads": -1,
"filename": "xnewsbot-0.6.0.tar.gz",
"has_sig": false,
"md5_digest": "127c333a65f6754678ee26d1975367e1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 111415,
"upload_time": "2025-07-19T06:36:20",
"upload_time_iso_8601": "2025-07-19T06:36:20.811300Z",
"url": "https://files.pythonhosted.org/packages/00/b9/11b6f91afc680afe692de120f697832787ff20a429fb8677e539a9c59748/xnewsbot-0.6.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-19 06:36:20",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "xnewsbot"
}