fediverse/README.md

84 líneas
10 KiB
Markdown
Original Vista normal Històric

2020-05-17 12:28:47 +02:00
# Fediverse Stats
2021-02-18 18:12:31 +01:00
This code gets all peers from running Mastodon, Pleroma and Lemmy host servers and then all peers from host server's peers. Goal is to collect maximum number
2020-05-17 12:28:47 +02:00
of alive fediverse's servers and then query their API to obtain their registered users (if their API provide such information).
At the end it post the results to host server bot account.
### Dependencies
- **Python 3**
- Postgresql server
- Mastodon or Pleroma running server.
### Usage:
Within Python Virtual Environment:
2021-05-14 10:39:26 +02:00
1. Run `pip install -r requirements.txt` to install needed libraries.
2020-05-17 12:28:47 +02:00
2021-05-14 10:39:26 +02:00
2. Run `python db-setup.py` to setup and create new Postgresql database and needed tables in it.
2020-05-17 12:28:47 +02:00
2021-05-14 10:39:26 +02:00
3. Run `python setup.py` to get your bot's access token of your Mastodon or Pleroma server existing account. It will be saved to 'secrets/secrets.txt' for further use.
2020-05-17 12:28:47 +02:00
2021-05-29 12:44:12 +02:00
4. Run `python getpeers.py` to get all peers from your host and the whole world of fediverse's servers (or almost the whole world).
2021-05-14 10:39:26 +02:00
5. Run `python fetchservers.py` to add servers to alive servers database.
6. Run `python fediverse.py` to query world alive servers API. It gets data from server's API according this table:
2020-05-17 12:32:11 +02:00
2020-05-19 21:18:00 +02:00
| Software | API peers | API users (nodeinfo/2.0.json) | API users (nodeinfo/2.0) | API users (api/v1/instance) | API users (main/nodeinfo/2.0) | API users (api/nodeinfo/2.0.json) | API users (api/nodeinfo) | Software |
|:--------------:|:---------------------:|:------------------------------------------:|:----------------------------------------------------------------------------------------------:|:---------------------------:|:-----------------------------:|:---------------------------------:|:---------------------------:|:--------------:|
| Diaspora | | ['usage']['users']['total'] | | | | | | Diaspora |
| Friendica | api/v1/instance/peers | | ['usage']['users']['total'] | | | | | Friendica |
| Ganggo | | | ['usage']['users']['total'] | | | | | Ganggo |
| GNU Social | | | | | ['usage']['users']['total'] | | | GNU Social |
| GNU Social 2.x | | | | | | ['usage']['users']['total'] | | GNU Social 2.x |
| Groundpolis | | | ['usage']['users']['total'] | | | | | Groundpolis |
| Hubzilla | | | ['usage']['users']['total'] | | | | | Hubzilla |
2021-02-18 18:09:56 +01:00
| Lemmy | api/v2/site ['federated_instances']['linked'] | ['usage']['users']['total']| | | | | | Lemmy |
2020-05-19 21:18:00 +02:00
| Mastodon | api/v1/instance/peers | ['usage']['users']['total'] (since v3.0.0) | | ['stats']['user_count'] | | | | Mastodon |
| Misskey | | | **NO** (['usage']['users'] returns {}) so using ['usage']['users']['activeHalfyear'] instead | | | | | Misskey |
| Osada | | | ['usage']['users']['total'] | | | | | Osada |
| Peertube | | ['usage']['users']['total'] | | | | | | Peertube |
| Pixelfed | | | | | | ['usage']['users']['total'] | | Pixelfed |
| Pleroma | api/v1/instance/peers | ['usage']['users']['total'] | | | | | | Pleroma |
| Plume | | | ['usage']['users']['total'] | | | | | Plume |
| Prismo | | | ['usage']['users']['total'] | | | | | Prismo |
| Ravenvale | | ['usage']['users']['total'] | | | | | | Ravenvale |
| Squus | | | ['usage']['users']['total'] | | | | | Squus |
| Writefreely | | | | | | | ['usage']['users']['total'] | Writefreely |
| Zap | | | ['usage']['users']['total'] | | | | | Zap |
2020-06-01 22:51:14 +02:00
| software | API | software name |
|-------------|:---------------------:|:--------------------:|
| diaspora | nodeinfo/2.0.json | ['software']['name'] |
| dolphin | nodeinfo/2.0 | ['software']['name'] |
| ganggo | nodeinfo/2.0 | ['software']['name'] |
| friendica | nodeinfo/2.0 | ['software']['name'] |
| gnusocial | main/nodeinfo/2.0 | ['software']['name'] |
| gnusocialv2 | api/nodeinfo/2.0.json | ['software']['name'] |
| groundpolis | nodeinfo/2.0 | ['software']['name'] |
| hubzilla | nodeinfo/2.0 | ['software']['name'] |
2021-02-18 17:59:53 +01:00
| lemmy | nodeinfo/2.0.json | ['software']['name'] |
2020-06-01 22:51:14 +02:00
| mastodon | nodeinfo/2.0.json | ['software']['name'] |
| misskey | nodeinfo/2.0 | ['software']['name'] |
| osada | nodeinfo/2.0.json | ['software']['name'] |
| peertube | nodeinfo/2.0.json | ['software']['name'] |
| pixelfed | api/nodeinfo/2.0.json | ['software']['name'] |
| pleroma | nodeinfo/2.0.json | ['software']['name'] |
| plume | nodeinfo/2.0 | ['software']['name'] |
| prismo | nodeinfo/2.0.json | ['software']['name'] |
| ravenvale | nodeinfo/2.0.json | ['software']['name'] |
| squs | nodeinfo/2.0 | ['software']['name'] |
| wordpress | wp-json/nodeinfo/2.0 | ['software']['name'] |
2020-06-01 22:51:14 +02:00
| writefreely | api/nodeinfo | ['software']['name'] |
| zap | nodeinfo/2.0.json | ['software']['name'] |
2020-05-17 13:39:24 +02:00
7. Run `python uptime_setup.py` to get your Uptime bot's access token of your Mastodon or Pleroma server existing account. It will be saved to 'secrets/uptime_secrets.txt' for further use.
2020-05-17 12:28:47 +02:00
8. Use your favourite scheduling method to set `python fediverse.py` to run twice daily, `python fetchservers.py` one time daily, `python getworld.py` to run monthly and `python uptime.py` (choose your desired frequency) if you want to publish best fediverse's servers uptime.
18.2.2021 - New feature! Added [Lemmy project](https://join.lemmy.ml)
12.5.2021 - New feature! Added Wordpress support. The code can now detect Wordpress instances with ActivityPub enabled plugin.
12.5.2021 - New feature! New shinny creation of servers and users graphs.
21.8.2021 - New feature! Added Best Fediverse's servers Uptime publishing bot.