Table: mastodon_follower - Query Mastodon Followers using SQL
Mastodon is a free and open-source self-hosted social networking service. It allows anyone to host their own server node in the network, and its various separately operated user bases are federated across many different sites. These sites are connected as a federated social network, allowing users from different servers to interact with each other.
Table Usage Guide
The mastodon_follower
table provides insights into follower relationships within the Mastodon social network. As a social media analyst, explore follower-specific details through this table, including follower and followed account details, and associated metadata. Utilize it to uncover information about followers, such as their relationships with other accounts, and the growth of their networks.
Important Notes
- You must specify the
followed_account_id
column in thewhere
orjoin
clause to query this table.
Examples
List followers
Discover the segments that have a high follower count in a social media platform. This can be used to identify popular users and understand their follower to following ratio, which can be useful for targeting influencer marketing campaigns.
select acct, username, display_name, followers_count, following_count, statuses_countfrom mastodon_followerwhere followed_account_id = '1'limit 10;
The PostgreSQL query provided does not contain any PostgreSQL - specific functionsor data types,JSON functions,or joins that would need to be converted to SQLite syntax.Therefore,the SQLite query is the same as the PostgreSQL query:select acct, username, display_name, followers_count, following_count, statuses_countfrom mastodon_followerwhere followed_account_id = '1'limit 10;
Count followers by month of account creation
Explore the growth of followers over time by counting the number of new followers added each month. This can help to understand the effectiveness of social media strategies and identify periods of significant growth or decline.
with my_account_id as ( select id :: text from mastodon_my_account limit 1)select to_char(mf.created_at, 'yyyy-mm') as created, count(*)from mastodon_follower mf join my_account_id mai on mf.followed_account_id :: text = mai.idgroup by createdorder by created
with my_account_id as ( select cast(id as text) as id from mastodon_my_account limit 1)select strftime('%Y-%m', mf.created_at) as created, count(*)from mastodon_follower mf join my_account_id mai on cast(mf.followed_account_id as text) = mai.idgroup by createdorder by created;
Schema for mastodon_follower
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The account ID. |
acct | text | username@server for the account. | |
created_at | timestamp with time zone | Timestamp when the account was created. | |
display_name | text | Display name for the account. | |
followed_account_id | text | = | ID of the account who is being followed. |
follower_account_id | text | ID of the follower account. | |
followers_count | bigint | Number of followers for the account. | |
following_count | bigint | Number of accounts this account follows. | |
instance_qualified_account_url | text | Account URL prefixed with my instance. | |
note | text | Description of the account. | |
server | text | Server for the account. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
statuses_count | bigint | Toots from this account. | |
url | text | URL for the account. | |
username | text | Username for the account. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- mastodon
You can pass the configuration to the command with the --config
argument:
steampipe_export_mastodon --config '<your_config>' mastodon_follower