This repository contains a set of scripts to create and post Markov chain-generated content to a Bluesky account using data retrieved from another Bluesky account.
- Fetches posts from a specified source account.
- Cleans and processes the retrieved content to ensure quality.
- Utilises Markov chain text generation to create new posts.
- Automatically posts generated content to a designated destination account.
- Logs all significant events and errors for debugging purposes.
To run this project, you will need the following:
- Python 3.x
- Required libraries (install via
pip
):dotenv
markovchain
atproto
You can install the required libraries using:
pip install python-dotenv markovchain atproto
-
Clone the repository:
git clone https://github.com/ewanc26/bluesky-markov.git cd bluesky-markov
-
Create a
.env
file in the root directory of the project and add your environment variables:SOURCE_HANDLE=your_source_handle DESTINATION_HANDLE=your_destination_handle CHAR_LIMIT=280 SRC_APP_PASS=your_source_app_password DST_APP_PASS=your_destination_app_password
- Navigate to the project directory.
- Run the main script:
python src/main.py
The application will log into the source and destination accounts, retrieve posts, generate new content based on the retrieved posts, and post the generated content to the destination account at random intervals.
All logs are stored in the log
directory. The logs are written to general.log
, where you can find details about the application's execution, including:
- Successful logins
- Retrieved posts
- Generated content
- Errors and exceptions
The project has the following structure:
project-root/
│
├── log/
│ └── general.log # Log file for application events
│
├── src/
│ ├── clean.py # Contains functions to clean retrieved content
│ ├── markov_gen.py # Handles Markov chain text generation
│ ├── time_utils.py # Utilities for time management and scheduling
│ ├── bsky_api.py # Functions for interacting with the Bluesky API
│ └── main.py # Main application logic
│
├── .env # Environment variables for authentication
└── README.md # Project documentation
Contributions are welcome! If you have suggestions for improvements or find bugs, feel free to open an issue or submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.