Hive13 IRC Bot
Property "ProjectImage" (as page type) with input value "Image:IRSSI.png|240px" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process.
|Hive13 IRC Bot|
|Start Date: 6/14/2010|
- 1 Overview
- 2 Project Status
- 3 What Needs to be Done
- 4 Project Needs
- 5 Project Information
- 6 Research
- 7 Resources
For a while now I have been meaning to work on an IRC bot for the Hive13 IRC room hosted on freenode.net (Webchat Link).
As of this moment the bot is live in the channel (HiveBot). He is logging the channel to a search-able MySQL database and publishing alerts as various Hive13 related RSS feeds are updated.
The channel log can be found at: http://portal.hive13.org/irclogger
Source code is currently located in an SVN repository hosted by Google Code . It is currently implemented as an Eclipse project. I currently have the project set up so that people can check out the code, but check-ins are disallowed unless you have an account. Until we move the code to a more appropriate location anyone that wants to commit changes can contact me and I (Paul) will add you to the correct user group.
Most of the initial goals have been met (Channel logging, tie the various communication mediums together, extensible framework) and I will be start work on some of the more longtime goals (Google calendar integration, Auto-opping group members)
- Add yourself here if you have contributed to this project.
User:Paul has found a Java IRC API library that makes accessing the IRC room a lot easier and has established the basic framework upon which various types of commands can be easily added.
"Passive" commands have their framework completed, these are commands that only respond to user input on the channels. For example, "!time" will activate the 'time' command which spits out the current time.
"Threaded" commands have most of their framework completed, but are still being investigated. These are commands that respond to external data and provide updates to the channel. For example, an RssReader that publishes updates to Hive13 related content to the channel.
"LineParse" commands are essentially "Passive" commands that parse every line that passes through the chat room and respond to them in some way. An example of this would be the "Linkify" command that searches every chat line for website links and generates short URL's and finds the page's title.
What Needs to be Done
- Research the feasibility of various ideas mentioned below.
- Google Calendar API
- The Google Calendar API is a PITA. I am still looking into it but what I mainly want is a simple way to say, "Are there any events happening in the next X days" and if the answer is yes, I just want the Date, Time and Name of that event. However the list I have gotten so far is a list of all events ever scheduled on the Hive13 calendar in no particular order and "Repeating" events are given no times.
- Google Calendar API
- Figure out an easily extensible design for the actual bot.
- Mostly done, still working out the details.
- Hammer out what all features people might like to see.
- Figure out how to authenticate users are who they say they are.
- This is because we do not want to auto-op someone named "Paul_Hive13" when it is really a random person who is just using my username.
- I think the final solution to this will be to use the /msg nickserv info <username> routine and then parse the returned messages. This however has been made painful due to the fact that I am discovering that the PircBot framework was not designed with multi-threading in mind and I have had to work around this by making as much of my stuff as possible asynchronous so I do not block the main thread.
- SVN Code Repository: http://code.google.com/p/hive13jircbot/source/checkout
- Public Checkout, contact Paul for commit permissions.
- Code is being written in Java with NetBeans 6.8
- SVN should contain all required libraries, code files, and config files to build and run the project.
- Project is using the PircBot framework.
- Project is using Project ROME for RSS feed parsing
IRC Task Automator
- Automatically give operator status to Hive13 members who join the IRC room.
- Username is too easily spoofed, so we need a way to check if the user is logged into an approved Freenode.net account before opping.
A bot would enable us to better tie the chat room into the other communication mediums we use as a group. As it stands now we are fractured into 3 major communication groups:
- Mailing List
- IRC Room
With numerous less utilized mediums:
- Google Calendar
- Hive13 Blog
- Hive13 Wiki
There are of course people that utilize all of these communications mediums, but there are also people that tends to stick to only one or two of them. The bot could help tie the other communication mediums into the IRC room while also tieing the chat room back into the communication loop.
- Automate alerting other people when someone says they are going to be at the hackerspace.
- Ex. User123 says, "I am going to be @hive13 in about an hour", Hive13Bot uses the Twitter API to send out a tweet stating: User13 said 'I am going to be @hvie13 in about an hour'
- Someone posts an update on either Youtube, Flickr, or the Hive13 Blog we send out an alert to the chat room, "Jimbo Jones just made a post on the Hive13 blog titled 'Lockpicking at Hive13' http://hive13.org/LockpickingLink"
- Use the Google calendar API to automatically update the topic of the chat room as events draw near.
This section is documenting research that has been done on the various goals. It will have links to additional information if needed.
IRC Automation Research
Auto-Opping Users on Freenode
The simplest way to implement this would be to just have a list of usernames, then when a new user joins a channel, or when the bot joins the channel, simply run through the list of usernames giving each one operator status. However, a major problem with this is that as soon as someone realizes that this is how the bot works, they can just join the channel, set their nick to a members username and receive operator status.
Freenode.net allows users to register usernames and then login with those usernames. If we can find a way to easily confirm that each user is genuinely that user prior to sending the op command, then it would greatly enhance the security of this operation. A quick Google search turns up the following: http://freenode.net/faq.shtml#spoofing . This page hints at using something called 'CAPAB IDENTIFY-MSG'. I have yet to determine exactly what this is or how we can use it. The section also links to a perl script, but I do not quite understand what the script is doing.
After some further research I found that if you message the nickserv bot it will tell you if a certain user is logged in or not. For example, '/msg nickserv info pvince' returns several messages that consist of a variety of information, if the user is logged in the "Last seen:" row says 'Now' if they are not logged in, there is a date.
Communication Aggregation Research
RSS Feed Alerts
- https://rome.dev.java.net/ - Java library for parsing (and creating) RSS Feeds
Google Calendar Topic Updates
- http://www.deaded.com/staticpages/index.php/pircbotdemos -- Other PircBots that we can reference for ideas and design help.