Install Mastoscore

The instructions in this document should probably be run once ever. After you've done this setup, you can just run the command with different options in the INI files.

1. Clone the Repository

git clone https://git.paco.to/mastoscore/mastoscore.git`

2. Setup Your Python Virtual Environment

python3 -m venv .venv
. .venv/bin/activate
pip install poetry
poetry install

3. Create your Starting INI File

This assumes you want to call your INI file mastoscore.ini. You'll probably have several of them if you're running analyses on several hashtags.

cp ini/EXAMPLE.ini ini/mastoscore.ini

4. (Optional) Jupyter

I prototyped a lot of the code in Jupyter before committing it to mastoscore. If you look in the jupyter folder you'll find a couple Jupyter notebooks.

Mastodon Setup

Mastoscore wants to toot from some account. You have to give it credentials to do that. You can use your own personal account, or you can sign up a bot account on a server somewhere. I'm going to assume your account is mastoscore@example.social in all the examples below.

5. Create your app on your server

This is basically an abridged version of the official Mastodon documentation

  1. Login on your server. I'll assume it's https://example.social/
  2. Create a new app. This means going to PreferencesDevelopmentNew Application. You can also just go to https://example.social/settings/applications/new
  3. Name it mastoscore or whatever you want
  4. Make sure it has read and write scopes
  5. Choose 'Create'
  6. You'll see 3 values on your screen that look like this. Save these values carefully!
Client key          R5_abcdefgabcdefgabcdefg
Client secret       5ra-abcdefgabcdefgabcdefg
Your access token   Mpwabcdefgabcdefgabcdefg

6. Create a credential file

I recommend creating a .env directory and sticking the credentials there. Git won't upload them.

  1. mkdir .env
  2. Copy the Client key, Client secret, and Access token into that file like this:
<Your access token>
<Your application web site>
<Client key>
<Client secret>

So, following the example above, we'd create a .env/mastoscore.env file that looks like:

Mpwabcdefgabcdefgabcdefg
https://example.social
R5_abcdefgabcdefgabcdefg
5ra-abcdefgabcdefgabcdefg

KEEP THIS FILE SAFE

This file is effectively a password to your account. Don't commit it to a code repository!

7. Make a data directory

I recommend having a separate directory called data where all the JSON files will go. You'll use this directory in the journaldir option of your INI file.

8. Edit your INI file

Before you can run an analysis, you need to set up your config.