Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ewanc26/bluesky-markov
A Markov chain bot for Bluesky.
https://github.com/ewanc26/bluesky-markov
bluesky-bot markov-chain
Last synced: about 1 month ago
JSON representation
A Markov chain bot for Bluesky.
- Host: GitHub
- URL: https://github.com/ewanc26/bluesky-markov
- Owner: ewanc26
- License: mit
- Created: 2024-06-09T08:29:57.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-13T16:23:10.000Z (7 months ago)
- Last Synced: 2024-06-13T19:15:01.611Z (7 months ago)
- Topics: bluesky-bot, markov-chain
- Language: Python
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bluesky Markov Bot
[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)
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.
## Table of Contents
- [Features](#features)
- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Logging](#logging)
- [File Structure](#file-structure)
- [Contributing](#contributing)
- [License](#license)## Features
- 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.## Requirements
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:
```bash
pip install python-dotenv markovchain atproto
```## Installation
1. Clone the repository:
```bash
git clone https://github.com/ewanc26/bluesky-markov.git
cd bluesky-markov
```2. Create a `.env` file in the root directory of the project and add your environment variables:
```plaintext
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
```## Usage
1. Navigate to the project directory.
2. Run the main script:
```bash
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.
## Logging
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## File Structure
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
```## Contributing
Contributions are welcome! If you have suggestions for improvements or find bugs, feel free to open an issue or submit a pull request.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.