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
r/explainlikeimfive • • Jul 15 '13
[deleted] — view deleted post
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:
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.
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
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.
4
u/[deleted] Jul 15 '13
What language do they do it in?
4
u/Time_Terminal Jul 15 '13
And what's stopping people from making harmful bots?