SnakeBot is a python jabber bot. It's probably a bad idea to try and use it right now. It's based on the minimalist http://thpinfo.com/2007/python-jabberbot/. It will be licensed under AGPLv3.
Source
http://svn.blagosphere.net/scripts/snakebot/trunk
Branches
JohnSullivan is breaking things in http://svn.blagosphere.net/scripts/snakebot/branches/johnsu01.
MattLee is maybe hacking on http://svn.blagosphere.net/scripts/snakebot/branches/mattl.
LoganIngalls is hacking on http://svn.blagosphere.net/scripts/snakebot/branches/lingalls.
Merging instructions: http://svnbook.red-bean.com/en/1.0/re16.html.
Trunk requirements
- python-xmppy
- python-twitter
- python-dictclient
- python-feedparser
- python-beautifulsoup
Commands
trunk
subscribe |
Subscribes the sender to the roster. |
status <user> |
Returns last twitter status message. In the future it should also show jabber away messages, identi.ca info, facebook info, last.fm, and maybe also a message that can be set manually. |
fortune |
Returns a random quote. In the future users should be able to teach it quotes that can be included in this output as well. |
dict <word> |
Returns definitions from dict.org. |
weather <zip code> |
Returns weather information. |
fact <something> <the rest> |
Associate <the rest> with key <something>. If there isn't any <the rest>, then show what it knows about <something>. Obviously this needs to handle a list of values per key, and have an interface for updating and deleting things. With no argument, show a random fact. |
reload |
restarts the bot. |
roster |
list all subscribers |
8ball |
Ask the Magic 8-Ball |
choose <choice> [<choice> ...] |
Pick a random <choice>. |
mbta |
Shows current MBTA alerts. |
version |
Return SVN revision number of running bot. |
johnsu01 branch
Everything in trunk.
Bugs
To Do
(Fully crossed-out things are done in trunk.)
Unsorted
- AGPLv3 compliance (maybe add a source command?)
Add version command, to say what version (svn revision number?) the current bot is running. (in johnsu01 branch)
Handle wrong zip codes entered for the weather command.
- Use decorators to indicate permission levels for commands?
Command to output current roster. (basic version working in johnsu01 branch)
- A wall command to send a message to everyone on the roster?
fact by itself should return a random fact.(in johnsu01 branch)
- A way to list all known facts?
Don't die if the username argument to status doesn't exist as a user on twitter.(fixed roughly in johnsu01 branch)
- Neural network associations between facts.
- Watch permissions on config file
- Parser -- pass arguments to commands as a list instead of a string
Expanded help capabilities -- help <command> should show lengthier information, maybe including things like the author of the command.
- Logging -- it's there, but we're not using it.
Have commands return something to be logged? (basic version working in johnsu01 branch)
- Add logfile setting to the conf file.
Fetch wiki pages (MoinMoin XML-RPC)
- Blacklist, to block specific users
- Superuser status, for doing bot configuration via Jabber
- Check for buffer overflow
- Automatically add back anyone who adds the bot to their roster
- More interesting replies to unknown commands
- Lunch: Tell you where to get lunch
- Get on IRC
Magic 8 Ball (lingalls has dibs)
random: given a list of things as argument, give you a random answer. Call it choose maybe? (lingalls has dibs)
- beer: give you a random beer recommendation based on the beer wiki
MBTA alerts
- Wiki revision notifications
- wikipedia -- return wikipedia links/pages
- Output paging, so that you can type more, or something like that.
- movie information
Facts -- teach the bot arbitrary bits of information. (very basic version working in johnsu01 branch)
weather (working in johnsu01 branch)
dict -- give definitions (working in johnsu01 branch)
Fortune (working in johnsu01 branch)
Status command
- Should indicate the last time the bot spoke with a particular user.
- identi.ca status updates
- ping.fm support for status command
- Add spot in conf file for ping.fm key
- Status command should also show facts about username.
- Associate some canonical username with various accounts (twitter etc.) for purposes of status.
Twitter status updates (working in johnsu01 branch)
Storage
Using python's shelve module for this right now. Do we need relational?
Namespaces
We need to store facts about different types of things, like users. Should we use separate shelves for each one (or at least the major ones)? Or just differentiate them by key? I'm leaning toward using a separate shelf for users, at least.
MBTA Service alerts
- Store information about alerts so that statistics can be compiled.
- Allow users to subscribe to alerts for specific lines.
- Check alerts during idle time.
- Modify syntax to get alerts on specific lines (like, "mbta red")
- Actually fetch the content of the advisory.
- Change to scrape info from the mobile version of the site, it should be easier.
<div id="service_alerts">
<h3><span>Service Alerts</span><img src="/images/h3-service_alerts-homepage.png" alt="Service Alerts" /></h3>
<ul id="serviceAlerts">
<li class="serviceAlert"><a href="/rider_tools/transit_updates/?ttype=boat">Boat</a> (1 alert)</li><li class="serviceAlert"><a href="/rider_tools/transit_updates/?ttype=cr">Commuter Rail</a> (2 alerts)</li><li class="serviceAlert"><a href="/rider_tools/transit_updates/?ttype=esc&route=Escalator#details">Escalator</a> (4 alerts)</li>
</ul>
<p>
<strong>
<a href="/rider_tools/transit_updates/">View all Service Updates</a> »<br />
<a href="/rider_tools/transit_updates/?ttype=esc">View Elevator/Escalator Status</a> »
</strong>
</p>
</div>