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:
workflow_dispatch:
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:
update-rss:
@ -14,4 +14,4 @@ jobs:
node-version: lts/*
cache: 'npm'
- 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)
.describe(description)
.option("--git", "Commit changes to git")
.action(async function main(){
.action(async function main({ git: is_git }){
let stats= [];
for(const instance of instances_cz_pre){
echo.use("-R", "Shromažďuji instance: " + instance);
@ -28,11 +28,24 @@ $.api("", true)
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 })
};
echo(JSON.stringify(out, null, " ")).to("./mastodonCzStats.json");
echo(JSON.stringify(out, null, " ")).to(store);
if(is_git) gitCommit([ store ], "cron");
$.exit(0);
})
.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) {
for(const instance of instances){
const { stats, mau, user_count }= await fetchInstanceStats(instance).catch(e=> ({}));

View File

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