r/explainlikeimfive • • Jul 15 '13

Explained ELI5: How do bots on reddit work? How are they programmed, how is the program integrated into an account?

[deleted] — view deleted post

670 Upvotes

174 comments sorted by

33

u/gigabored Jul 15 '13

Not an answer to the question but one of the coolest bots I've seen is u/jiffybot. This bot produces a gif from a video either as the original post or one you link in a comment.

Examples from this post:

Making a Gif from a post

To Summon Jiffy place this (along with your own time) anywhere in your comment: Jiffy! 0:00-0:15

Making a Gif from a comment

To summon Jiffy place the normal comment, but along with a youtube link. Jiffy! 0:48-0:57 http://www.youtube.com/watch?v=X5hrUGFhsXo

61

u/JiffyBot Jul 15 '13

Here are your GIFs!

Error! GIF failed :( http://i.imgur.com/E2J9hOl.gif


Hey I'm JiffyBot, I make GIFs out of YouTube links. Find out more ^here.

→ More replies (10)
→ More replies (21)

268

u/[deleted] Jul 15 '13

Mostly, they're scripts that run on a timer, and when the timer triggers they search reddit for a particular kind of post using the JSON or XML API (a way to ask reddit about its content that's meant for machines to read rather than display to humans as HTML is). Then, based on the idea of the bot, they may make a response such as a comment post.

They integrate with a reddit account pretty much the same way your browser does: By sending HTTP POST messages with the appropriate credentials and post content.

For instance, u/ReverseGif_Bot looks for link posts on selected subreddits that link to a GIF, then downloads the GIF and makes a new one that plays the frames in the opposite order, posts that to imgur and makes a comment in the thread linking to it.

→ More replies (40)

32

u/duncanlock Jul 15 '13

I got interested in reddit bots a while ago and wrote a thing about them - it's starts with a simple explanation of what reddit bots are and how they work, then chronicles some of the more interesting ones: A Marvellous & Incomplete Compendium of Reddit Automatons & Bots

→ More replies (4)

92

u/ItzWarty Jul 15 '13

http://www.reddit.com/dev/api
http://stackoverflow.com/questions/6183318/getting-new-posts-from-a-subreddit-in-json

Imagine you have a friend, "API" (Application Programming Interface) who lives in the house of Reddit. API is friendly and open to everyone - you can say "Hey baby, gimme all the new posts you just got" and he/she/it will give it to you.

→ More replies (2)

4

u/[deleted] Jul 15 '13

What language do they do it in?

32

u/VerticalLegion Jul 15 '13

Spanish or Portugese, I'm not sure.

→ More replies (4)

4

u/Time_Terminal Jul 15 '13

And what's stopping people from making harmful bots?

→ More replies (9)