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.

Metadata

Release files for statsbadge-mastodon 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statsbadge-mastodon 2.0.0
File Size Uploaded Provenance Actions
statsbadge_mastodon-2.0.0.tar.gz 9.0 kB Without provenance Details for statsbadge_mastodon-2.0.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for statsbadge-mastodon 2.0.0
File Interpreter ABI Platform Actions
statsbadge_mastodon-2.0.0-py3-none-any.whl Python 3 none any Details for statsbadge_mastodon-2.0.0-py3-none-any.whl

Total release size: 18.5 kB

Release files / statsbadge_mastodon-2.0.0.tar.gz

Download URL statsbadge_mastodon-2.0.0.tar.gz
Size 9.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a952aa3d58333fc47979a48f1388ecfd2be5395630a6b63cce7c2fdb81aeacae
BLAKE2b-256 checksum
How to use checksums
c389c4ae2f3c620a7ffcbd0119f2303eefd560024028e133a2286f5d4b85d29b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / statsbadge_mastodon-2.0.0-py3-none-any.whl

Download URL statsbadge_mastodon-2.0.0-py3-none-any.whl
Size 9.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
38b31362269bac015514b310aa045e92cf270c81a53161f049713c9277d2a9e1
BLAKE2b-256 checksum
How to use checksums
4d75e951937451880f02984ee696fb4f30cccb71e91d9a43775d811d19d8f4c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.12.18 {"installer":{"name":"uv","version":"0.12.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for statsbadge-mastodon 2.0.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files No provenance

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