Skip to main content

statsbadge-mastodon

Your Mastodon timeline and account, for statsbadge.

The newest post in your feed, the newest mention, the newest notification of any kind and your last post, alongside your followers, following, posts and unread count. Add a Notifications page and put any mixture of them on it: the messages stack down the page and the counters go in a strip along the bottom.

Install

statsbadge ext add mastodon

Then, in the config UI under Extensions, set your instance and paste your access token.

The token

In Mastodon: Preferences → Development → New application. Give it a name, leave the scopes at read (that is all this asks for), and save. The application's page then shows Your access token.

Paste that and your instance's host - fosstodon.org, no https:// - into the settings. The token is stored in the host's config file in plain text. The config page keeps it masked behind Edit secrets.

Settings

Setting What it does
Instance The host your account is on
Access token The token above
Ask every Seconds between refreshes. 120 by default
Pictures off, small or large - see below

Pictures

One picture per post, where the post has one: the first attachment, cropped to what is actually in it and drawn in the theme's palette.

small is 64x48 in four shades and adds about 950 bytes to a message; large is 128x96 in eight and adds about 4KB. Four subsequent posts with images might cause animation hiccups so choose carefully.

What it reports

Four of these are messages, and go on a Notifications page as a block of text with who it is from and how long ago:

Reading What it is
Latest in your feed The newest post on your home timeline
Latest mention The newest post that mentioned you
Latest notification The newest of any kind - a follow, a favourite, a boost
Your latest post Your own newest, replies and boosts excluded

The rest are numbers, and go anywhere a number goes:

Reading What it is
Followers
Following
Posts
Unread notifications
Likes on your latest
Boosts on your latest

Followers and following are kept hourly, so a graph of either shows a week rather than the last ninety seconds. Mastodon reports no history of its own, so that ring is built as the host runs: it is empty on a first launch and fills an hour at a time.

Notes

Four requests a refresh, against a limit of 300 in five minutes, so the default of two minutes is 1/40th of the API limit.

A boost includes no content of its own - the content is on the post inside it - so the original post is drawn with "boosted by" beside it.

Post bodies arrive as HTML. Tags go, entities are decoded, and paragraph and line breaks become spaces rather than being dropped. They are cut to 160 characters on the server, comfortably more than the two or three lines a page draws.

Mastodon "readings" change every couple of minutes and the badge polls every second, so they are declared slow: the host sends them when they change and the badge holds on to them.

Download files

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

Source Distribution

statsbadge_mastodon-1.1.0.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statsbadge_mastodon-1.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file statsbadge_mastodon-1.1.0.tar.gz.

File metadata

  • Download URL: statsbadge_mastodon-1.1.0.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.2

File hashes

Hashes for statsbadge_mastodon-1.1.0.tar.gz
Algorithm Hash digest
SHA256 ffe2fd6d5db5de08fc6d258331bf2dfae9c6af2ba1bbb39dfce63ac51127b71b
MD5 de902868904eab10fc02ee86fe67cbdf
BLAKE2b-256 ef905ce7bac1d11394ebe8b5e6364ceba44cb64439804538114715f3fd3c47af

See more details on using hashes here.

File details

Details for the file statsbadge_mastodon-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for statsbadge_mastodon-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4cb61e1ced90cc848e1ea0772de4fdb6fe589e1f8eabdfac47c79e2b249aa195
MD5 e711987c7a3ee03e9626b6d8293ebd7f
BLAKE2b-256 046adad4316b526b022246995b73c75a0ad87a093910d4175d35b0ceec3d8f00

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page