CityBot2 is a Python-based application designed to create social media posts for a local area. The initial version supports news source RSS feeds and government data on weather and earthquakes. It can post to Bluesky, Facebook, LinkedIn, and Twitter/X.
You can download it to your server and schedule it to run with city-specific customizations. Testing and improvements are welcome!
This is a major upgrade and full rewrite of the original CityBot (archived).
Table of Contents
Disclaimer: This app comes with no warranties or guarantees. Use it at your own risk. It's recommended to use a virtual environment to keep your dependencies isolated from the rest of your system.
- Ensure you have a recent version of Python installed.
- Create and activate a virtual environment.
- Update
pip
.
Example:
mkdir CityBot2
cd CityBot2
python3 -m venv venv
source venv/bin/activate
pip install --upgrade pip
-
Clone the repository:
git clone https://github.com/ericrosenberg1/CityBot2 cd CityBot2
-
Install dependencies:
pip install -r requirements.txt
-
Configure city and credentials:
cd config mv credentials.env.example credentials.env nano credentials.env
Update credentials and save.
Update city configuration:
nano city_example.json
Set your city details, save, and exit.
-
Run the app:
cd .. python main.py
-
View logs:
tail -f logs/citybot.log
CityBot2 may require system dependencies for mapping and geospatial support. On Debian/Ubuntu systems, you might need:
- python3-pip
- python3-dev
- build-essential
- libatlas-base-dev
- gfortran
- libgeos-dev
- libproj-dev
- proj-data
- proj-bin
- libcairo2-dev
- pkg-config
- python3-cartopy
- cutycapt
After configuration and installation, run python main.py
to start the bot. Check logs/citybot.log
for activity and error messages.
- Create documentation
- Improve error handling
- Create a basic web GUI
- Make it easier to update city configurations
- Publish on PyPi or provide apt install method
See the open issues for a full list of proposed features and known issues.
Contributions are welcome! If you find a bug or have a suggestion, open an issue or create a pull request.
- Fork the Project
- Create a feature branch (
git checkout -b feature/AmazingFeature
) - Commit changes (
git commit -m 'Add AmazingFeature'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Stars are appreciated!
Distributed under the GPLv3 License. See LICENSE.txt
for more information.
- Claude.ai for initial code assistance
- GPT4Readability for inspiration
- Best-README-Template for README structure