epilys / proboscis

mastodon follower tracking (please do not use for unhealthy social media obsession reasons, it's for curiosity/fun only)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

proboscis License No Maintenance Intended

Mastodon follower tracking (please do not use for unhealthy social media obsession reasons, it's for curiosity/fun only)

SERIOUSLY TAKE IT EASY!

Create an sqlite3 database with this schema:

CREATE TABLE snapshot (
  id INTEGER PRIMARY KEY ASC,
  date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
  api_count INTEGER NOT NULL,
  json_count INTEGER NOT NULL,
  json TEXT NOT NULL CONSTRAINT is_valid_json CHECK(json_valid(json))
) STRICT;

The STRICT syntax is relatively new, if it's not recognized in your sqlite3 version, you can just remove it.

Why both api_count and json_count? Personally I found them not to agree, which is what prompted me to track changes in case I can figure out a pattern that explains it.

Example

Do not directly copy paste this, since it includes the > line prefix of the Here document.

$ sqlite3 followers.db << 'EOF'
> CREATE TABLE snapshot (
>   id INTEGER PRIMARY KEY ASC,
>   date TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
>   api_count INTEGER NOT NULL,
>   json_count INTEGER NOT NULL,
>   json TEXT NOT NULL CONSTRAINT is_valid_json CHECK(json_valid(json))
> ) STRICT;
> EOF
$ 

Optionally run it on a schedule

$ crontab -e

append:

# m h  dom mon dow   command
0 0,12,18 * * * /bin/bash /home/user/.local/bin/mastodon_stats.sh >> /home/user/.local/share/mastodon/run.log

About

mastodon follower tracking (please do not use for unhealthy social media obsession reasons, it's for curiosity/fun only)

License:European Union Public License 1.2


Languages

Language:Shell 100.0%