15 February 1988
15 February 1988
Testing automated posting. Sorry for any bugs :D
15 February 1988
Testing automated posting. Sorry for any bugs :D
I grabbed scanned copies of the books from the seven seas, which are higher quality than the ones available on gocomics. Since these are being pirated anyways, I figured using that would be a better option. I also ran them through a imagemagik script to try and automatically rearrange the comics so they're more mobile friendly. I've attached an example. Feel free to poke me for the sources and the script if that's something that interests you.
@m_f@lemm.ee noticed you're the new mod. Just got a minimum viable bot to continue the daily posting done.
Neat! You should definitely post then, it's better if I'm not the single-point-of-failure for comics posting. I'll post my still-somewhat-wip script for posting the Peanuts comic, which uses GoComic and probably has a lot of overlap with C&H.
I run python post_stuff.py
, which imports other scripts for each comic and runs them. get_lemmy.py
handles caching auth credentials for up to several days (I'm sure it could go longer but I haven't checked the docs yet). Caching the creds and running it all from a wrapper entry point keeps the number of logins down, which I was getting rate limited on. It doesn't currently handle accounts with MFA enabled, but it should be pretty resilient to stuff like file upload failing.
You can just ignore the image munging bits and probably some other bits, that was for turning the 1x4 Peanuts strip into a 2x2 post here. You might find interesting stuff by poking around on the site, Peanuts has a transcript for each comic in the HTML, though I don't see that for C&H.
I've also been meaning to publish the git repo somewhere, hopefully this will motivate me to get around to doing that.
cc @db0@lemmy.dbzer0.com on ☝️btw, pythorhead
has been super useful! You might be interested in the use case of handling creds like I do there, maybe that's something the library could do?
Mine's just 54 lines right now. Executed daily as a cron job. Wrote in some simple checks that enable it to account for leap days, or being behind. It can be made to catch up simply by having it run more than once a day.
I should make it cache the login, too.
It can be made to post any comic on gocomics, daily, in sync, simply by editing a config toml.