Python, Deliver Us the Blue Hellsite | cmdr-nova@internet:~$

Python, Deliver Us the Blue Hellsite

Follow me via:





Have you ever thought to yourself, “Self, I wish there was more Tumblr on Mastodon?” Well, do I have some freakin’ news for you. In my sickness addled brain, I have slapped together something that will tickle your pickle, or fancy. With a few lines (100 or so) of Python, we can force the Tumblr API to give us whatever it thinks is the top trending image post of the day, and slap that thing onto ActivityPub. Matt might be trying to bury Wordpress in a shallow grave, but maybe we can pretend that Tumblr has ActivityPub integration with some hacks.

The full script is over here on Github.

Now, I don’t know for sure yet if this will capture more than one post. I currently have it setup on a cronjob that makes a post daily, and in my experimenting, it only seemed to grab the one post. This is why I’ve set it up to run once a day, to see if that post ever changes. You can see what the script output in my testing, below, on my Mastodon account.

Post by @cmdr_nova@mkultra.monster
View on Mastodon

There is a way to grab every single trending post on Tumblr, and then sort out the image posts, and then post one of those posts at random, but! You are limited to the amount of times you can make an API call to Tumblr, per day, and this would very likely push you right over that limit, because, in order to do this, you have to make many, many API calls.

I should also add a warning, I haven’t built-in any way to classify image posts, meaning, this could pull lewd or offensive content without warning, which is why I have it setup to always post with image sensitivity and a spoiler warning. I may look into figuring out implementing that later, along with possibly figuring out a way to have all my scripts give some kind of alt text to images (but I imagine that won’t be possible unless I implement AI, which I don’t think I want to do).

Either way, enjoy!


mkultra.monster is independent, in that it is written, developed, and maintained by one person. Written, developed, and maintained, not for scrapers, bots, scammers, algorithms, or grifters: But for people to follow and read, just like the way it used to be, back in the golden age of the internet.
mkultra.monster is independent, in that it is written, developed, and maintained by one person. Written, developed, and maintained, not for scrapers, bots, scammers, algorithms, or grifters: But for people to follow and read, just like the way it used to be, back in the golden age of the internet.


WEBMENTIONS

Have you written a response to this post? Send me a webmention!

📝 How to send a webmention

To send a webmention, your response page must contain an exact link to this post and be publicly fetchable.

  • A blog post that mentions or links to this article
  • A public webpage that includes the exact canonical URL
  • Any webpage that references this content

After creating your response, paste the URL below. Social posts often need a bridge such as Bridgy before they appear as webmentions here.

Webmention submitted!
It may take a few moments to appear.

Error submitting webmention.

FEDIVERSE COMMENTS

You can use your Mastodon or other ActivityPub account to comment on this article by replying to the associated post.