[Help] Creating a Reddit IRC Bot reddit / irc ---------------------------------------------------------------------- interbol · 2011-09-06 02:21 Every time there is a new post in a subreddit, I would like the bot to make an announcement in the IRC channel with a link to the new post. I saw it in r/soccer's irc channel. How do I create one for my subreddit's channel? Please note that I am a beginner in IRC. ---------------------------------------------------------------------- tobsn · 2011-09-06 03:10 no you don't. ---------------------------------------------------------------------- [deleted] · 2011-09-06 04:57 There are two parts: * poll reddit for changes. they have an nice json api, no problems expected there. * talk on irc. google "$language_you_like irc bot" for the module you need. Are you also a beginner to programming? I can't figure out what kind of help you are asking for. ---------------------------------------------------------------------- interbol · 2011-09-06 05:39 It looks like [this](http://i.imgur.com/Z8PFo.jpg) in the IRC channel. Everytime someone would make a post in the subreddit, the bot would make an announcement about it in the IRC channel automatically. ---------------------------------------------------------------------- Farow · 2011-09-06 14:15 This. If you're having trouble using irc, creating a bot would be pretty much impossible at this stage. ---------------------------------------------------------------------- [deleted] · 2011-09-06 15:24 The thing you want to do is clear. What part of it are you having trouble creating? ---------------------------------------------------------------------- interbol · 2011-09-06 15:37 I am new to IRC and I do not now where to start to create this. Do I get my subreddit's rss feed to create the bot to make channel announcements everytime a new post has been made in my subreddit? ---------------------------------------------------------------------- [deleted] · 2011-09-06 15:43 What language are you writing this in? What kind of computer will it run on? Like I said earlier, you should be able to google "$language irc bot" to find the module you want to use. Parsing an rss feed sounds like a fine way to handle that end, so google "$language rss parser" to get the module you need for programmically reading the feed to check for updates. ---------------------------------------------------------------------- [deleted] · 2011-09-12 07:59 [deleted] ---------------------------------------------------------------------- pconwell · 2011-09-16 16:53 I'm *not* new to IRC or programming in general, but have never worked with IRC bots before. Know of any good starting points? I've googled some stuff, but I'm still lost. ---------------------------------------------------------------------- sparkey0 · 2011-09-17 00:34 EDIT: I see that someone wrote a more concise version of this 10 days ago. my bad - i'll leave this in case any of this is useful to you. -------- I'm assuming you have some programming knowhow, and have a language preference, so i'll leave that type of stuff out. The components here are: - machine to run the bot, server someplace or your own machine, whatever - component to poll reddit periodically for changes (eg: load + parse http://www.reddit.com/r/irc/.rss ) - storage for last state of the subreddit - can be as simple as a file containing the latest post date known, or as complex as a database of posts, metadata, number of comments etc - component that compares states in an appropriate way (comments, post date) - periodic scheduler to trigger polling (cron or wharever) - IRC communication library (pircx, botzilla, or similar). can do the connection etc manually, but using one of these libraries will cut your dev time - component that takes the information learned from state comparison and acts on it, implementing the IRC library and sending off appropriate data to the channel Note that you should spend plenty of time testing in a neutral channel somewhere so you don't drive everyone nuts -- it would be very easy to end up flooding and getting banned A few options here depending on language preference java: http://www.jibble.org/pircbot.php php: http://botzilla.org ---------------------------------------------------------------------- interbol · 2011-09-17 02:22 I asked one of the mods at r/soccer and he was kind enough to give me the code [here](http://pastebin.com/vwj4VDWv). He used a [Supybot](http://supybook.fealdia.org/devel/) on a python server. I have no idea how to program and very new to IRC so I do not know where to start installing the bot. I want to bot to be in #reddit-csuf irc channel and make an announcement in the irc channel every time there is a new topic created in r/csuf. ---------------------------------------------------------------------- sparkey0 · 2011-09-17 04:42 Ah ok, the script he sent over is the config for his usage of the bot. Check out line 815 in his config, he's enabling an RSS reader plugin for Supybot that will post to that channel when new entries appear. Basically the proc I described above Download the source or a bin for supybot here: http://sourceforge.net/projects/supybot/ If you modify his config to point to the right serv, channel, subreddit RSS etc, seems like that should do what you want just fine :) ---------------------------------------------------------------------- staz · 2011-09-25 21:48 Depends on what language you want to use. The fastest way is either search for a library or for an existing bot which allow plugins. ---------------------------------------------------------------------- staz · 2011-09-25 21:50 We did something like this on a channel I created, but instead of developing it we just took a bot who print rss update and feed it the subreddit rss feed. ---------------------------------------------------------------------- Rotten194 · 2011-11-28 09:41 IRC is dead simple. Try connecting with a Telnet client and just watching what comes over the wire, you'll figure it out fast. To connect: USER 8 * : NICK wait for `PING :` and reply `PONG :` (COLON IS IMPORTANT) You are now talking irc. Try `JOIN :#channel` and listen. ---------------------------------------------------------------------- Hello71 · 2011-12-03 04:29 Colon is not important unless the PING code contains a space (the delimiter). The IRC RFC requires that the client send `PASS` before being registered.