Do you want to know what your most popular note on a Sharkey instance is?
-
Do you want to know what your most popular note on a Sharkey instance is?
Check out this little script: https://codeberg.org/fotoente/Fedi-tools/src/branch/main/popular_post -
Do you want to know what your most popular note on a Sharkey instance is?
Check out this little script: https://codeberg.org/fotoente/Fedi-tools/src/branch/main/popular_post@Erpel@hai.z0ne.social
Was also curious, wrote an SQL thingy:SELECT note.id, u.username, SUM((value)::int) AS total_reactions, CONCAT('https://plasmatrap.com/notes/', note.id) AS note_url FROM note JOIN public."user" u ON u.id = note."userId" CROSS JOIN jsonb_each(reactions) WHERE "host" IS NULL GROUP BY note.id, username, note_url ORDER BY total_reactions DESC LIMIT 25;
-
@Erpel@hai.z0ne.social
Was also curious, wrote an SQL thingy:SELECT note.id, u.username, SUM((value)::int) AS total_reactions, CONCAT('https://plasmatrap.com/notes/', note.id) AS note_url FROM note JOIN public."user" u ON u.id = note."userId" CROSS JOIN jsonb_each(reactions) WHERE "host" IS NULL GROUP BY note.id, username, note_url ORDER BY total_reactions DESC LIMIT 25;
@privateger@plasmatrap.com nice. m idea was that a normal user might not have acces to the database this way, so I used the API