Difference between revisions of "Hive13 IRC Bot"

From Hive13 Wiki
Jump to navigation Jump to search
(IRC Automation Research)
m (Contributors: Removing invalid link)
 
(33 intermediate revisions by 7 users not shown)
Line 1: Line 1:
 +
''This is the current Hive13 IRC Bot. For the old bot, see [[Hive13Bot]]''
 
{{Infobox Project
 
{{Infobox Project
 
|ProjectTitle=Hive13 IRC Bot
 
|ProjectTitle=Hive13 IRC Bot
|ProjectImage=[[Image:IRSSI.png|240px]]
+
|ProjectImage=Image:IRSSI.png|240px
|ProjectStatus=Active
+
|ProjectStatus=Inactive
 
|StartDate=6/14/2010
 
|StartDate=6/14/2010
 
}}
 
}}
Line 10: Line 11:
 
For a while now I have been meaning to work on an IRC bot for the Hive13 IRC room hosted on freenode.net ([http://webchat.freenode.net/?randomnick=1&channels=hive13&prompt=1 Webchat Link]).
 
For a while now I have been meaning to work on an IRC bot for the Hive13 IRC room hosted on freenode.net ([http://webchat.freenode.net/?randomnick=1&channels=hive13&prompt=1 Webchat Link]).
  
This bot will start off by just automating simple tasks, for example auto-opping membersA goal of the project is to make the bot easily extensible with new features allowing us to adapt and improve the bot as time goes on.
+
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.
  
Source code is currently located at [[User:Paul|Paul's]] SVN server http://svn.caffeinesystems.com/hive13/trunk/Hive13JavaChat .  It is currently implemented as a NetBeans 6.8 java 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 set up an SVN account for you.
+
The channel log can be found at: http://portal.hive13.org/irclogger
  
Longer term goals include tieing the bot into the Twitter API and the Google Calendar API.
+
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)
  
 
=== Project Manager ===
 
=== Project Manager ===
Line 20: Line 23:
  
 
=== Contributors ===
 
=== Contributors ===
 +
* Cjdavis
 
* Add yourself here if you have contributed to this project.
 
* Add yourself here if you have contributed to this project.
  
 
= Project Status =
 
= Project Status =
[[User:Paul]] has found a Java IRC API library that makes accessing the IRC room a lot easier and created a simple demo project.  The project has been added to an SVN serverCurrently brainstorming ideas for implementation.
+
[[User:Paul]] has the bot in a state where it is currently active in the #hive13 channel on freenode.net.
 +
 
 +
== Features ==
 +
* Channel Logging
 +
** The bot logs all events in the channel to http://portal.hive13.org/irclogger/
 +
** The logs can be searched for keywords.
 +
** The logs page can show all messages since a user was last seen in the channel.
 +
* Maintains a list of authorized users at multiples levels (Unauthorized, Known, Operator, Admin)
 +
** When a user joins the channel the bot checks that user against a list of users and will then give them the appropriate authorization level.
 +
** If a user is on the 'Op' or 'Admin' list they will be given channel operator status.
 +
** The 'Known' list is currently not fully implemented but would be used to give users voice in channel.
 +
** The commands users can run is determined by their Authorization level.  For instance, an Unauthorized users can not use the !Op command to give other users operator status.
 +
** A users identity is verified by checking their nickname against the nickserv and a whitelist of nicknames.  If the nickserv reports back that the nickname is registered to a whitelisted user, and that user is currently logged in, then they are given the correct Authorization Level.
 +
* Shortens URL's pasted into the channel and determines the target pages title.
 +
* Can be subscribed to RSS feeds, then when a new item is published in that feed it will alert the channel to that event.
 +
** This is a very, very flexible command.  The bot can be subscribed to any valid RSS feed and then the message it posts to the channel during an alert is completely configurable.
 +
** Currently the bot is subscribed to the following sites for Hive13 related content.
 +
*** This wiki's edit feed
 +
*** The Hive13 blog
 +
*** The Hive13 tag on Flickr
 +
*** The Hive13 Mailing list
 +
*** Any post containing 'Hive13' on twitter.
 +
* Tell command
 +
** Ex. !Tell Username This message will be delivered when Username is next seen talking in chat.
 +
* Time command
 +
** Displays the current time
 +
** AuthLevel: Unauthorized
 +
* Quit Command
 +
** Shuts the bot down
 +
** AuthLevel: Admin
 +
* Op Command
 +
** Has two functions:
 +
**# An Unauthorized user who runs the command has their credentials rechecked.
 +
**#* Ex. !op
 +
**# An Authorized user can give other users an Operator Authlevel, this requires Operator AuthLevel.
 +
**#* Ex. !op Username
 +
* Plugin List command
 +
** Returns a list of commands that the running user is authorized to execute.
 +
** Ex. !plugins
 +
 
 +
== Command Types ==
 +
"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 wayAn 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 =
 
= What Needs to be Done =
 
* Research the feasibility of various ideas mentioned below.
 
* Research the feasibility of various ideas mentioned below.
 
** Google Calendar API
 
** Google Calendar API
** Twitter 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.
** How adaptable is the PircBot library?
+
* Maintain an easily extensible design for the actual bot.
* Figure out an easily extensible design for the actual bot.
 
 
* Hammer out what all features people might like to see.
 
* Hammer out what all features people might like to see.
 +
* Implement ChannelStats
 +
* Implement Seen
 +
** Aka, when was a user last seen in channel.
 +
* RSS Feed Aggregation
 +
* Flesh out the config file for loading // configuring plugins
 +
* Formatted log messages
  
 
= Project Needs =
 
= Project Needs =
  
 
= Project Information =
 
= Project Information =
* SVN Code Repository: http://svn.caffeinesystems.com/hive13/trunk/Hive13JavaChat
+
* Code has migrated to GitHub: https://github.com/Hive13/jIRCBot
** Public Checkout, contact [[User:Paul|Paul]] for commit permissions.
+
** Code is being written in Java with Eclipse as an IDE.
** Code is being written in Java with NetBeans 6.8
+
** GIT 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 the PircBot framework.
 
** Homepage: http://www.jibble.org/pircbot.php
 
** Homepage: http://www.jibble.org/pircbot.php
 
** API Documentation: http://www.jibble.org/javadocs/pircbot/index.html
 
** API Documentation: http://www.jibble.org/javadocs/pircbot/index.html
 +
* Project is using Project ROME for RSS feed parsing
 +
** Homepage: https://rome.dev.java.net/
 +
** Requires you include the jdom library from: http://www.jdom.org/
 +
* Project is using the Bitlyj API for URL shortening
 +
** Homepage: http://code.google.com/p/bitlyj/
 +
* Project will be using the Google Java API for google calendar.
  
 
== Goals ==
 
== Goals ==
=== IRC Task Automator ===
+
=== IRC Task Automater ===
Goals
 
 
# Automatically give operator status to Hive13 members who join the IRC room.
 
# 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.
+
#* '''*Implemented*''' - ''Users must be authenticated w/ NickServ first.''
  
 
=== Communication Aggregator ===
 
=== Communication Aggregator ===
[[Image:CommunicationMediumsCurrent.png|400px|right]]
+
[[Image:CommunicationMediumsCurrent.png|right]]
 
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:
 
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
+
# Mailing List '''*Implemented*'''
# IRC Room
+
# IRC Room (That is where we are, duh)
# Meetings
+
# Meetings '''*Implemented*''' ''(Through the wiki updates)''
  
 
With numerous less utilized mediums:
 
With numerous less utilized mediums:
* Twitter
+
* Twitter '''*Implemented*'''
* Youtube
+
* Youtube '''*Implemented*'''
* Flickr
+
* Flickr '''*Implemented*'''
* Google Calendar
+
* Google Calendar '''*Implemented*'''
* Hive13 Blog
+
* Hive13 Blog '''*Implemented*'''
* Hive13 Wiki
+
* Hive13 Wiki '''*Implemented*'''
  
 
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.
 
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.
Line 69: Line 128:
 
* Automate alerting other people when someone says they are going to be at the hackerspace.
 
* 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'
 
** 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.
+
=== Virtual to Physical Communication ===
 +
We have the [[Pro-Lite Display]] display at the hackerspace as well has the [[GoldenTee Display]].  I would love to create something that ties these physical displays into a communication medium between the IRC chat room and the hackerspace.  This way we can address messages from the chat room to the physical hackerspace.
 +
 
 +
For instance, if someone in the #hive13 chat room were to send:
 +
* !hive13 Hey, is anyone there?
 +
An alert would sound in the hackerspace and the message would start scrolling on the displays.  There would be a kiosk computer set up near the display, or the maybe just a keyboard hooked up to a uC, that would allow that person at the hackerspace to respond.
 +
 
 +
=== Physical to Virtual Alerts ===
 +
This has already been implemented and has been tied to the [[Hackerspace Open Switch]] project.  This is only a 1-way communication and works via a generated RSS feed: http://www.hive13.org/isOpen/RSS.php
  
 
= Research =
 
= Research =
Line 79: Line 146:
  
 
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.
 
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 ==
 
== Communication Aggregation Research ==
 
=== @Hive13 Alerts ===
 
=== @Hive13 Alerts ===
 
=== RSS Feed Alerts ===
 
=== RSS Feed Alerts ===
 +
* https://rome.dev.java.net/ - Java library for parsing (and creating) RSS Feeds
 +
 
=== Google Calendar Topic Updates ===
 
=== Google Calendar Topic Updates ===
  

Latest revision as of 19:40, 15 May 2018

This is the current Hive13 IRC Bot. For the old bot, see Hive13Bot



Hive13 Project
Hive13 IRC Bot
IRSSI.png
Status: Inactive
Start Date: 6/14/2010


Overview

Summary

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)

Project Manager

Contributors

  • Cjdavis
  • Add yourself here if you have contributed to this project.

Project Status

User:Paul has the bot in a state where it is currently active in the #hive13 channel on freenode.net.

Features

  • Channel Logging
    • The bot logs all events in the channel to http://portal.hive13.org/irclogger/
    • The logs can be searched for keywords.
    • The logs page can show all messages since a user was last seen in the channel.
  • Maintains a list of authorized users at multiples levels (Unauthorized, Known, Operator, Admin)
    • When a user joins the channel the bot checks that user against a list of users and will then give them the appropriate authorization level.
    • If a user is on the 'Op' or 'Admin' list they will be given channel operator status.
    • The 'Known' list is currently not fully implemented but would be used to give users voice in channel.
    • The commands users can run is determined by their Authorization level. For instance, an Unauthorized users can not use the !Op command to give other users operator status.
    • A users identity is verified by checking their nickname against the nickserv and a whitelist of nicknames. If the nickserv reports back that the nickname is registered to a whitelisted user, and that user is currently logged in, then they are given the correct Authorization Level.
  • Shortens URL's pasted into the channel and determines the target pages title.
  • Can be subscribed to RSS feeds, then when a new item is published in that feed it will alert the channel to that event.
    • This is a very, very flexible command. The bot can be subscribed to any valid RSS feed and then the message it posts to the channel during an alert is completely configurable.
    • Currently the bot is subscribed to the following sites for Hive13 related content.
      • This wiki's edit feed
      • The Hive13 blog
      • The Hive13 tag on Flickr
      • The Hive13 Mailing list
      • Any post containing 'Hive13' on twitter.
  • Tell command
    • Ex. !Tell Username This message will be delivered when Username is next seen talking in chat.
  • Time command
    • Displays the current time
    • AuthLevel: Unauthorized
  • Quit Command
    • Shuts the bot down
    • AuthLevel: Admin
  • Op Command
    • Has two functions:
      1. An Unauthorized user who runs the command has their credentials rechecked.
        • Ex. !op
      2. An Authorized user can give other users an Operator Authlevel, this requires Operator AuthLevel.
        • Ex. !op Username
  • Plugin List command
    • Returns a list of commands that the running user is authorized to execute.
    • Ex. !plugins

Command Types

"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.
  • Maintain an easily extensible design for the actual bot.
  • Hammer out what all features people might like to see.
  • Implement ChannelStats
  • Implement Seen
    • Aka, when was a user last seen in channel.
  • RSS Feed Aggregation
  • Flesh out the config file for loading // configuring plugins
  • Formatted log messages

Project Needs

Project Information

Goals

IRC Task Automater

  1. Automatically give operator status to Hive13 members who join the IRC room.
    • *Implemented* - Users must be authenticated w/ NickServ first.

Communication Aggregator

CommunicationMediumsCurrent.png

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:

  1. Mailing List *Implemented*
  2. IRC Room (That is where we are, duh)
  3. Meetings *Implemented* (Through the wiki updates)

With numerous less utilized mediums:

  • Twitter *Implemented*
  • Youtube *Implemented*
  • Flickr *Implemented*
  • Google Calendar *Implemented*
  • Hive13 Blog *Implemented*
  • Hive13 Wiki *Implemented*

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.

Goals

  • 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'

Virtual to Physical Communication

We have the Pro-Lite Display display at the hackerspace as well has the GoldenTee Display. I would love to create something that ties these physical displays into a communication medium between the IRC chat room and the hackerspace. This way we can address messages from the chat room to the physical hackerspace.

For instance, if someone in the #hive13 chat room were to send:

  • !hive13 Hey, is anyone there?

An alert would sound in the hackerspace and the message would start scrolling on the displays. There would be a kiosk computer set up near the display, or the maybe just a keyboard hooked up to a uC, that would allow that person at the hackerspace to respond.

Physical to Virtual Alerts

This has already been implemented and has been tied to the Hackerspace Open Switch project. This is only a 1-way communication and works via a generated RSS feed: http://www.hive13.org/isOpen/RSS.php

Research

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

@Hive13 Alerts

RSS Feed Alerts

Google Calendar Topic Updates

Resources