Skip to main content

Post to Mastodon

Project description

postodon

PyPI Changelog License

Randomly posts things to Mastadon from a list using the API.

The list of posts is a JSON file:

[
    {"content": "Text of the post", "id": 1, "status": "unposted"},
    ...,
]

The command postodon randomly selects an unposted post, posts it to Mastodon, and marks it as posted in the list. If there are no unposted items, an already-posted item is used instead.

Installation

Install:

python3 -m venv .venv
source .venv/bin/activate
pip install postodon

Usage

Setup

Use

To use, put the access token in an environment variable called AUTH_TOKEN:

export AUTH_TOKEN=<your_access_token_here>

To publicly post a random post, marked as English, and update the list (mark the post having been posted):

postodon

(This is a shortcut for postodon post). NB if there are no unposted posts left in the list, this will return a random post from the 'posted' selection.

To select a random post from the list without either updating the list or posting (dry-run mode):

postodon post -n

To add new posts to the list for future posting:

postodon add "Text of post"

Development

To contribute to this library, first checkout the code. Then create a new virtual environment:

cd postodon
python -m venv .venv
source .venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[dev,tests]'

To run the tests:

pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

postodon-0.0.3.tar.gz (7.3 kB view hashes)

Uploaded Source

Built Distribution

postodon-0.0.3-py3-none-any.whl (8.6 kB view hashes)

Uploaded Python 3

Supported by

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