Run an Analysis

If you're ready to run an analysis, that's because you already installed mastoscore and set up your analysis with a mastoscore.ini file. There's an example.ini file that shows you what the options are. You can also go to the code repo and look at the ini/ directory to see some of the actual INI files I use at various times. Be warned that the features and syntax changed over time. Some older INI files will not have all the bells and whistles of newer ones.

The command line takes a minimum of 2 arguments: the INI file and the action you want to do. It also takes an optional --debug parameter that will display some information. Without the --debug option, it's pretty quiety. With --debug=info you get informative progress messages. With --debug=debug you get a lot of noise.

1. Fetch

First, you go fetch all the toots related to your hashtag. This will take time. For #monsterdon, my laptop connects to around 113 different servers, fetching 40 toots at a time. Thanks to the way federation works, you end up fetching the same toots many times! On a Monsterdon Sunday, there are often around 2000 toots. But the fetch module will frequently fetch 80,000 or more. That's because when someone at mastodon.social toots something related to #monsterdon it is federated to a lot of servers. All 113 servers will send me a copy of that toot. There's a bunch of work in the fetch module to de-duplicate and handle all that. Fetching those 80,000 toots takes my laptop around 26 minutes. On the other hand, some less popular watch parties like #iliketowatch and #kungfusat will complete in a minute or less.

mastoscore --debug=info mastoscore.ini fetch

When this is done, you'll have a bunch of JSON files in your journaldir directory, organized in a hierarchical structure based on the event date (YYYY/MM/DD). See the fetch module for a description of the structure and the files.

2. Analyse

Analyse reads all the JSON files created by the fetch command and analyses them. Mostly this deduplicates the posts and then calculates all the top scores. It creates an analysis.json file.

mastoscore mastoscore.ini analyse

3. Graphs

This will generate the graph file showing the timeline of toots over time and the wordcloud from the posts. See the graph module and the wordcloud module for more information.

mastoscore mastoscore.ini graphs

Take a look at the wordcloud alt-text file. You'll see text like:

Top 10 most frequent words were:
pumpkinhead: 625, pumpkin: 96, monster: 76, kid: 72, gonna: 62, think: 55, really: 54,
know: 52, magiccrystal: 52, time: 49,

You may find that some of the popular words aren't much fun to include (like yeah or really). So edit your INI file and change the stopwords parameter. Add those words to the list and rerun the wordcloud command to get a new wordcloud. There's no good way to do this other than to make a wordcloud, see what comes out, and then decide what you want to keep and remove. A lot of times I find a #monsterdon event for a film like The Howling (1981) will have a bunch of variations on the hashtag: #Howling, #TheHowling, and #TheHowling1981. I usually exclude all but one of them.

mastoscore mastoscore.ini wordcloud

4. Post

At this point, you have everything you need to post. The post command will connect to your Mastodon server and post the analysis in a series of linked posts. I recommend setting dry_run to True until you're confident in it. Note that I developed this on infosec.exchange, which allows 11,000 characters in a toot. It's likely that if you're on a server with the standard limit of 500 characters, this will totally fail. It will try to create a gigantic post and then it will get rejected. It would be useful to support that case.

mastoscore mastoscore.ini post

5. Post Graphs

This will post the generated graph and wordcloud images to Mastodon. It posts as a standalone public post.

mastoscore mastoscore.ini postgraphs

The system includes fallback mechanisms if directories can't be created or files can't be written to the preferred locations. For example, if the graphs directory can't be created, files will be saved to the journal directory instead.