RE: https://m29.us/@jucika/117225180507360701 Minor nerdery ahead: When I first ...
Ryan Finnie @ryan@m29.us
RE: https://m29.us/@jucika/117225180507360701
Minor nerdery ahead: When I first created this bot, it literally just posted a random comic each day. I quickly started encountering the same comics being posted near each other, including an instance of the same comic being posted twice in a row, out of a pool of 414.
I solved this by creating a random seed for each run, then shuffling the run based on the seed. When the run is complete, a new seed is picked so it doesn't loop over the same shuffle each run.
I saw today's comic and thought "didn't this one just come up?" And yes, it was last posted on August 12. Turns out today is day 2 of the new run, and it just happened to pick a comic from near the end of the previous run. Random's gonna random.
https://forge.colobox.com/rfinnie/mastodon-apps/src/branch/main/mastodon_apps/jucika.py