Usage for testing:
./get_latest_jsons.sh
./show_human_readable_timestamps.sh
If - for example - that showed that the latest JSON was 1691258704964.json:
./tcbot.sh TEST 1691258704964 0

This will show Community subscriber growth between the latest update and what happens to be currently be in the TEST folder (1691042690884.txt, from 2023-08-03), and then the data from “1691258704964” would become the new base, for the next update to compare its data to.

The REAL mode is what updates !trendingcommunities@feddit.nl

Requires bash, curl, bc, and jq. Don’t think anything is particularly version-dependent, though.

Comments are welcome. I’m not too fussed about efficiency, as the bulk of it only runs once a day, but any suggestions for improvement are welcome.

  • Efwis@lemmy.zipM
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I didn’t find anything personally wrong with the script working, I’m trying to figure out a bash script that will notify me of new members joining as well as one that will notify me of new posts to the community. unfortunately I’m not very well versed in bash scripting. Do you think you could come up with some rudimentary bash script that would allow this to push a notification to my desktop? I use KDE so I would need to figure out a way to push the info to that DE. Any help would be appreciated.

    • freamonOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      1 year ago

      I just use ntfy for notifications. I’ve only ever got the python3 version to install (with ‘apt install python3-pip’ and then ‘pip3 install ntfy’), but after that’s done, a desktop notification can be sent with:

      ntfy -b linux send 'msg'