this post was submitted on 20 Feb 2025
26 points (100.0% liked)

Fedigrow

913 readers
37 users here now

To discuss how to grow and manage communities / magazines on Lemmy, Mbin, Piefed and Sublinks

Resources:

founded 10 months ago
MODERATORS
 

Is there a way to access engagement stats for a community to make a (daily) time series? Something along the lines of exporting data ever 24 hours at 2:00 UTC.

This is the data I am referring to:

daily

Perhaps an API of some sort. A formal method that goes beyond writing a scrapper.

you are viewing a single comment's thread
view the rest of the comments
[–] PhilipTheBucket@ponder.cat 3 points 3 days ago* (last edited 3 days ago) (1 children)

IDK if this counts as "writing a scraper," but from tmux you could:

echo '"Daily Users","Weekly Users","Monthly Users","6-Month Users","Community ID","Subscribers","Posts","Comments"' > stats.csv

while true; do
    curl "https://YOUR_INSTANCE/api/v3/community?name=COMMUNITY_NAME" \
        | jq -r '[.community_view.counts | (.users_active_day, .users_active_week, .users_active_month, .users_active_half_year, .community_id, .subscribers, .posts, .comments)] | @csv' >> stats.csv
    sleep 24h
done

Edit: No auth needed, it's simple

[–] nutomic@lemmy.ml 2 points 3 days ago (1 children)

That request doesnt need any auth.

[–] PhilipTheBucket@ponder.cat 3 points 3 days ago

Oop, you're right, fixed.