Compare commits

...

2 Commits

Author SHA1 Message Date
Bot
4f962851b7
Updated by bot – cron 2024-06-28 14:06:00 +02:00
dcf1a45684
cron + git 2024-06-28 14:04:53 +02:00
3 changed files with 218 additions and 196 deletions

View File

@ -1,8 +1,8 @@
name: Update RSS name: Collect month data
on: on:
workflow_dispatch: workflow_dispatch:
schedule: schedule:
- cron: '39 19 * * *' # daily at 19:39 Prague - cron: '0 12 1 * *' # At 12:00 Prague on the first day of the month
jobs: jobs:
update-rss: update-rss:
@ -14,4 +14,4 @@ jobs:
node-version: lts/* node-version: lts/*
cache: 'npm' cache: 'npm'
- run: npm ci - run: npm ci
- run: npx nodejsscript cli.mjs pull --git - run: npx nodejsscript mastodonCzStats.js --git

View File

@ -9,7 +9,7 @@ $.api("", true)
.version(version) .version(version)
.describe(description) .describe(description)
.option("--git", "Commit changes to git") .option("--git", "Commit changes to git")
.action(async function main(){ .action(async function main({ git: is_git }){
let stats= []; let stats= [];
for(const instance of instances_cz_pre){ for(const instance of instances_cz_pre){
echo.use("-R", "Shromažďuji instance: " + instance); echo.use("-R", "Shromažďuji instance: " + instance);
@ -28,11 +28,24 @@ $.api("", true)
instances_cz: stats.sort((a, b)=> b.registrations-a.registrations), instances_cz: stats.sort((a, b)=> b.registrations-a.registrations),
sum: stats.reduce((acc, stats) => sumStats([acc, stats]), { statuses: 0, logins: 0, registrations: 0, mau: 0, user_count: 0 }) sum: stats.reduce((acc, stats) => sumStats([acc, stats]), { statuses: 0, logins: 0, registrations: 0, mau: 0, user_count: 0 })
}; };
echo(JSON.stringify(out, null, " ")).to("./mastodonCzStats.json"); echo(JSON.stringify(out, null, " ")).to(store);
if(is_git) gitCommit([ store ], "cron");
$.exit(0); $.exit(0);
}) })
.parse(); .parse();
function gitCommit(files, des= "not specified"){
if(!files.length || !s.run`git diff --numstat`.trim())
return echo("Nothig todo");
echo("Diff to save");
s.run`git config user.name "Bot"`;
s.run`git config user.email "${"zc.murtnec@naj.elrdna".split("").reverse().join("")}"`;
s.run`git add ${files}`;
s.run`git commit -m "Updated by bot ${des}"`;
s.run`git push`;
s.run`git config --remove-section user`;
}
async function* collectStats(instances, weeks = 1) { async function* collectStats(instances, weeks = 1) {
for(const instance of instances){ for(const instance of instances){
const { stats, mau, user_count }= await fetchInstanceStats(instance).catch(e=> ({})); const { stats, mau, user_count }= await fetchInstanceStats(instance).catch(e=> ({}));

View File

@ -2,180 +2,198 @@
"instances_cz": [ "instances_cz": [
{ {
"instance": "mastodonczech.cz", "instance": "mastodonczech.cz",
"mau": 741, "mau": 752,
"user_count": 5300, "user_count": 5312,
"week": 8579960795, "week": 8591530195,
"statuses": 10560, "statuses": 10850,
"logins": 2059, "logins": 2325,
"registrations": 12 "registrations": 16
}, },
{ {
"instance": "witter.cz", "instance": "witter.cz",
"mau": 260, "mau": 248,
"user_count": 1482, "user_count": 1488,
"week": 8579976030, "week": 8591832860,
"statuses": 2624, "statuses": 1836,
"logins": 705, "logins": 701,
"registrations": 10 "registrations": 6
},
{
"instance": "f.cz",
"mau": 46,
"user_count": 119,
"week": 8579983760,
"statuses": 894,
"logins": 142,
"registrations": 3
}, },
{ {
"instance": "mastodon.arch-linux.cz", "instance": "mastodon.arch-linux.cz",
"mau": 178, "mau": 167,
"user_count": 2987, "user_count": 2997,
"week": 8579851790, "week": 8591687250,
"statuses": 6207, "statuses": 6461,
"logins": 498, "logins": 428,
"registrations": 2 "registrations": 5
},
{
"instance": "f.cz",
"mau": 49,
"user_count": 124,
"week": 8591747175,
"statuses": 1379,
"logins": 146,
"registrations": 4
}, },
{ {
"instance": "mastodon.pirati.cz", "instance": "mastodon.pirati.cz",
"mau": 36, "mau": 50,
"user_count": 379, "user_count": 383,
"week": 8580233190, "week": 8591587150,
"statuses": 97, "statuses": 293,
"logins": 103, "logins": 122,
"registrations": 4
},
{
"instance": "mamutovo.cz",
"mau": 8,
"user_count": 12,
"week": 8591647100,
"statuses": 413,
"logins": 23,
"registrations": 3
},
{
"instance": "cztwitter.cz",
"mau": 131,
"user_count": 769,
"week": 8591724400,
"statuses": 1583,
"logins": 346,
"registrations": 2
},
{
"instance": "gomastodon.cz",
"mau": 5,
"user_count": 242,
"week": 8591620775,
"statuses": 0,
"logins": 6,
"registrations": 2
},
{
"instance": "social.filik.eu",
"mau": 6,
"user_count": 9,
"week": 8591827515,
"statuses": 6,
"logins": 15,
"registrations": 2
},
{
"instance": "nasface.cz",
"mau": 8,
"user_count": 1388,
"week": 8591676940,
"statuses": 1,
"logins": 11,
"registrations": 1
},
{
"instance": "mastodon.urbancloud.cz",
"mau": 13,
"user_count": 17,
"week": 8591655020,
"statuses": 13,
"logins": 39,
"registrations": 1
},
{
"instance": "spondr.cz",
"mau": 4,
"user_count": 4,
"week": 8591442460,
"statuses": 152,
"logins": 16,
"registrations": 1 "registrations": 1
}, },
{ {
"instance": "toot.whatever.cz", "instance": "toot.whatever.cz",
"mau": 5, "mau": 5,
"user_count": 55, "user_count": 56,
"week": 8580260155, "week": 8591576265,
"statuses": 33, "statuses": 43,
"logins": 16, "logins": 15,
"registrations": 1 "registrations": 0
}, },
{ {
"instance": "kompost.cz", "instance": "kompost.cz",
"mau": 11, "mau": 11,
"user_count": 33, "user_count": 33,
"week": 8580261425, "week": 8591446410,
"statuses": 214, "statuses": 233,
"logins": 43, "logins": 39,
"registrations": 1
},
{
"instance": "mamutovo.cz",
"mau": 7,
"user_count": 10,
"week": 8579983910,
"statuses": 422,
"logins": 21,
"registrations": 1
},
{
"instance": "nasface.cz",
"mau": 12,
"user_count": 1387,
"week": 8579868095,
"statuses": 0,
"logins": 17,
"registrations": 0
},
{
"instance": "cztwitter.cz",
"mau": 131,
"user_count": 766,
"week": 8580176805,
"statuses": 1578,
"logins": 368,
"registrations": 0
},
{
"instance": "gomastodon.cz",
"mau": 2,
"user_count": 240,
"week": 8580124535,
"statuses": 0,
"logins": 1,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.macsnet.cz", "instance": "mastodon.macsnet.cz",
"mau": 3, "mau": 3,
"user_count": 52, "user_count": 52,
"week": 8580040610, "week": 8591630330,
"statuses": 136, "statuses": 167,
"logins": 12, "logins": 12,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "lgbtcz.social", "instance": "lgbtcz.social",
"mau": 6, "mau": 8,
"user_count": 44, "user_count": 44,
"week": 8579846185, "week": 8591463030,
"statuses": 4, "statuses": 7,
"logins": 19, "logins": 16,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "boskovice.social", "instance": "boskovice.social",
"mau": 9, "mau": 10,
"user_count": 26, "user_count": 26,
"week": 8580066670, "week": 8591731330,
"statuses": 129, "statuses": 82,
"logins": 36, "logins": 33,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.1984.cz", "instance": "mastodon.1984.cz",
"mau": 3, "mau": 3,
"user_count": 20, "user_count": 20,
"week": 8579954685, "week": 8591673075,
"statuses": 0, "statuses": 0,
"logins": 11, "logins": 12,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.rozhlas.cz", "instance": "mastodon.rozhlas.cz",
"mau": 5, "mau": 6,
"user_count": 18, "user_count": 18,
"week": 8580242605, "week": 8591809005,
"statuses": 269, "statuses": 305,
"logins": 18, "logins": 20,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "fediverse.cz", "instance": "fediverse.cz",
"mau": 2, "mau": 1,
"user_count": 18, "user_count": 18,
"week": 8579869890, "week": 8591563520,
"statuses": 0, "statuses": 0,
"logins": 5, "logins": 5,
"registrations": 0 "registrations": 0
}, },
{
"instance": "mastodon.urbancloud.cz",
"mau": 11,
"user_count": 16,
"week": 8579982050,
"statuses": 14,
"logins": 32,
"registrations": 0
},
{ {
"instance": "kocour.club", "instance": "kocour.club",
"mau": 9, "mau": 8,
"user_count": 14, "user_count": 14,
"week": 8579926635, "week": 8591574535,
"statuses": 27, "statuses": 26,
"logins": 39, "logins": 28,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "ajtaci.club", "instance": "ajtaci.club",
"mau": 1, "mau": 1,
"user_count": 9, "user_count": 9,
"week": 8579844105, "week": 8591499030,
"statuses": 4, "statuses": 4,
"logins": 5, "logins": 5,
"registrations": 0 "registrations": 0
@ -184,45 +202,36 @@
"instance": "mastodon.darksheep.social", "instance": "mastodon.darksheep.social",
"mau": 0, "mau": 0,
"user_count": 11, "user_count": 11,
"week": 8580159440, "week": 8591478175,
"statuses": 0, "statuses": 0,
"logins": 0, "logins": 0,
"registrations": 0 "registrations": 0
}, },
{
"instance": "social.filik.eu",
"mau": 4,
"user_count": 7,
"week": 8580201360,
"statuses": 12,
"logins": 13,
"registrations": 0
},
{ {
"instance": "social.meyer.cz", "instance": "social.meyer.cz",
"mau": 4, "mau": 4,
"user_count": 9, "user_count": 9,
"week": 8579926085, "week": 8591583210,
"statuses": 125, "statuses": 139,
"logins": 16, "logins": 17,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.starnet.cz", "instance": "mastodon.starnet.cz",
"mau": 2, "mau": 2,
"user_count": 7, "user_count": 7,
"week": 8579859190, "week": 8591587000,
"statuses": 10, "statuses": 12,
"logins": 6, "logins": 6,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "blogator.com", "instance": "blogator.com",
"mau": 0, "mau": 2,
"user_count": 5, "user_count": 5,
"week": 8579917765, "week": 8591581115,
"statuses": 0, "statuses": 0,
"logins": 0, "logins": 3,
"registrations": 0 "registrations": 0
}, },
{ {
@ -236,73 +245,64 @@
}, },
{ {
"instance": "mastodon.loutaci.cz", "instance": "mastodon.loutaci.cz",
"mau": 0, "mau": 1,
"user_count": 7, "user_count": 7,
"week": 8580272895, "week": 8591552095,
"statuses": 0, "statuses": 1,
"logins": 1, "logins": 3,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.skorpil.cz", "instance": "mastodon.skorpil.cz",
"mau": 3, "mau": 3,
"user_count": 3, "user_count": 3,
"week": 8579901010, "week": 8591420460,
"statuses": 22, "statuses": 11,
"logins": 12, "logins": 10,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.hinata.cz", "instance": "mastodon.hinata.cz",
"mau": 1, "mau": 1,
"user_count": 3, "user_count": 3,
"week": 8580250055, "week": 8591465235,
"statuses": 0, "statuses": 0,
"logins": 4, "logins": 5,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "social.toxwat.cz", "instance": "social.toxwat.cz",
"mau": 2, "mau": 1,
"user_count": 4, "user_count": 4,
"week": 8580186065, "week": 8591731740,
"statuses": 0, "statuses": 0,
"logins": 2, "logins": 1,
"registrations": 0
},
{
"instance": "spondr.cz",
"mau": 3,
"user_count": 3,
"week": 8579861675,
"statuses": 217,
"logins": 15,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "hlidacstatu.social", "instance": "hlidacstatu.social",
"mau": 1, "mau": 1,
"user_count": 3, "user_count": 3,
"week": 8580261595, "week": 8591440675,
"statuses": 1, "statuses": 0,
"logins": 4, "logins": 1,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.train.cz", "instance": "mastodon.train.cz",
"mau": 1, "mau": 2,
"user_count": 2, "user_count": 2,
"week": 8579852440, "week": 8591576985,
"statuses": 0, "statuses": 0,
"logins": 4, "logins": 6,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "social.bobek.cz", "instance": "social.bobek.cz",
"mau": 1, "mau": 1,
"user_count": 2, "user_count": 2,
"week": 8579922885, "week": 8591585510,
"statuses": 0, "statuses": 1,
"logins": 5, "logins": 5,
"registrations": 0 "registrations": 0
}, },
@ -310,7 +310,7 @@
"instance": "social.blep.cz", "instance": "social.blep.cz",
"mau": 1, "mau": 1,
"user_count": 2, "user_count": 2,
"week": 8579976085, "week": 8591784145,
"statuses": 0, "statuses": 0,
"logins": 4, "logins": 4,
"registrations": 0 "registrations": 0
@ -319,7 +319,7 @@
"instance": "mastodon.haxo.cz", "instance": "mastodon.haxo.cz",
"mau": 0, "mau": 0,
"user_count": 2, "user_count": 2,
"week": 8580272925, "week": 8591552775,
"statuses": 0, "statuses": 0,
"logins": 0, "logins": 0,
"registrations": 0 "registrations": 0
@ -328,8 +328,8 @@
"instance": "mutant.cz", "instance": "mutant.cz",
"mau": 1, "mau": 1,
"user_count": 2, "user_count": 2,
"week": 8580107325, "week": 8591787130,
"statuses": 5, "statuses": 6,
"logins": 4, "logins": 4,
"registrations": 0 "registrations": 0
}, },
@ -337,62 +337,53 @@
"instance": "mastodon.gmb.cz", "instance": "mastodon.gmb.cz",
"mau": 1, "mau": 1,
"user_count": 1, "user_count": 1,
"week": 8580144695, "week": 8591805170,
"statuses": 0, "statuses": 0,
"logins": 4, "logins": 2,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "rodina-sucha.cz", "instance": "rodina-sucha.cz",
"mau": 1, "mau": 1,
"user_count": 1, "user_count": 1,
"week": 8580244660, "week": 8591817085,
"statuses": 85, "statuses": 66,
"logins": 5, "logins": 4,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "social.taborsky.cz", "instance": "social.taborsky.cz",
"mau": 1, "mau": 1,
"user_count": 1, "user_count": 1,
"week": 8580259410, "week": 8591585510,
"statuses": 2, "statuses": 2,
"logins": 4, "logins": 5,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "cynikobecny.cz", "instance": "cynikobecny.cz",
"mau": 2, "mau": 1,
"user_count": 2, "user_count": 2,
"week": 8579852145, "week": 8591512610,
"statuses": 50, "statuses": 158,
"logins": 2, "logins": 4,
"registrations": 0 "registrations": 0
}, },
{ {
"instance": "mastodon.morwud.cz", "instance": "mastodon.morwud.cz",
"mau": 1, "mau": 1,
"user_count": 1, "user_count": 1,
"week": 8580096015, "week": 8591766055,
"statuses": 5, "statuses": 4,
"logins": 4, "logins": 4,
"registrations": 0 "registrations": 0
}, },
{
"instance": "mastodon.ok1bt.cz",
"mau": 0,
"user_count": 7,
"week": 8579952040,
"statuses": 0,
"logins": 0,
"registrations": 0
},
{ {
"instance": "torsten.cz", "instance": "torsten.cz",
"mau": 1, "mau": 1,
"user_count": 4, "user_count": 4,
"week": 8580264110, "week": 8591490015,
"statuses": 13, "statuses": 18,
"logins": 5, "logins": 5,
"registrations": 0 "registrations": 0
}, },
@ -400,8 +391,8 @@
"instance": "mastodon.zs-studanka.cz", "instance": "mastodon.zs-studanka.cz",
"mau": 1, "mau": 1,
"user_count": 1, "user_count": 1,
"week": 8579992375, "week": 8591832910,
"statuses": 10, "statuses": 17,
"logins": 4, "logins": 4,
"registrations": 0 "registrations": 0
}, },
@ -409,17 +400,35 @@
"instance": "social.vojtat.cz", "instance": "social.vojtat.cz",
"mau": 1, "mau": 1,
"user_count": 1, "user_count": 1,
"week": 8580261025, "week": 8591589575,
"statuses": 0, "statuses": 0,
"logins": 3,
"registrations": 0
},
{
"instance": "boy.s.cz",
"mau": 1,
"user_count": 8,
"week": 8591727055,
"statuses": 303,
"logins": 3,
"registrations": 0
},
{
"instance": "social.jirutka.cz",
"mau": 1,
"user_count": 2,
"week": 8591668745,
"statuses": 56,
"logins": 4, "logins": 4,
"registrations": 0 "registrations": 0
} }
], ],
"sum": { "sum": {
"statuses": 23780, "statuses": 24659,
"logins": 4276, "logins": 4470,
"registrations": 31, "registrations": 47,
"mau": 1512, "mau": 1528,
"user_count": 13072 "user_count": 13125
} }
} }