How to prevent image hotlinking

Well, the technical part is pretty easy – and just a quick Google search away. There are even online tools that give you the code you need.

The fun part is – what data do you send to the perpetrators.

Now, it doesn’t seem like you can really do much harm. Yes, the obvious thing to do is to show an image that says “Please host your own images”. Some people may not even know how bad hotlinking is (for example, when you run a small VPS and you have to support a heavy traffic of several much larger websites). Sometimes, the people running a website don’t even know they are hotlinking; they just used a free WordPress theme that came with the offending code.

Well, in my case, I knew people had to go out of their way to get the images, so I thought I’d give them a bit of a lesson.

At first, I thought I’d redirect the traffic to a large file that would slow down their websites. It turns out it’s not easy to find a free image hosting that supports files over 900MB. Bummer.

So my second idea was to rickroll them.

This was fun and all, but then I wondered – can I do better? Is there a way to use my situation to make the world a better place? Of course!


More tutorials

A tinted screenshot showing the finished bot posting a flag and asking about a corresponding capital, followed by a reply from me with a correct answer, and the bot accepting it.
A tinted screenshot of profile fields on Mastodon, showing a newly added

Automating your Mastodon profile with

Show the current time and weather in your city, change your profile picture, or show what you're currently listening to on your Mastodon profile.

#api #automation #mastodon #mastodon-api #mastodon-py #pipedream-com

Screenshot of the finished Mastodon bot posting a protest art image with a raised fist in solidarity.

💻 Browse all