• Home
  • Help
  • Search
  • Login
  • Register
Pages: [1]
Author Topic: Google talk interface  (Read 3451 times)
ryanm
Newbie
*

Karma: 0
Posts: 3


View Profile
« on: January 16, 2010, 06:41:12 AM »

Howdy all. I got my plug last week and in short order was torrenting, sharing, serving media and all that good stuff. One problem remained: making it easy for the wife to use.

To this end, I whipped up a simple bot that sits on Google talk and responds to commands
  • where : reports local and global IPs - this one's more for my benefit
  • ushare : refreshes uShare's media list
  • ushare restart : the nuclear option - restarts ushare
  • <url> : if there's a torrent at that url, add it to transmission via RPC
  • iplayer <program> : Looks through the available list of the BBC iPlayer for the given program: if there's one match, a download is started; more than one match and it replies with the possibilities so you can narrow it down
  • unrar : deals with torrents that have been split into multiple rar files, extracts and deletes the rars
  • tell <who> <what> : relays a message to someone else, mainly used for passive-aggressive sniping so far
  • status : Lists the progress of your iPlayer download and unrar processes, etc
If all else fails, it'll respond with a random nugget of (often scarily relevant) wisdom.

Nice features:
  • I don't have to explain ssh to her indoors
  • We've got a netbook that is slightly too slow to use the BBC's flash-based iPlayer application smoothly, even with the file pre-downloaded. This downloads and converts to a format that VLC handles with ease over samba
  • We can start torrents/iPlayer downloads from anywhere (iPhone, etc) without having to mess about with opening ports on the firewall, worrying about dynamic IPs, etc
  • It can hold a pretty good conversation, given that the responses are random

It's worked rather well so far, so I thought I'd share: All the code (plus a handy pre-built jar) can be found here. It's written in java, so you'll need to "apt-get install openjdk-6-jre-headless" to get a JVM first. From there, it's just a case of running "java -jar SheevaSage.jar <config file>" in a screen session, where <config file> is a text file containing:
Code:
sheevasage.googleID = agoogleIDforyourbot@googlemail.com
sheevasage.googlePass = thepasswordforthatID
sheevasage.torrentdir = /the/path/to/your/torrent/dir
sheevasage.iplayerdir = /the/path/to/your/iplayer/dir

it uses transmission, ushare, unrar, killall and get_iplayer to do the clever bits, so you'll have to have them installed.

Can anyone think of any other commands which would be useful?
« Last Edit: January 30, 2010, 08:13:01 AM by ryanm » Logged

noelportugal
Newbie
*

Karma: 0
Posts: 1


View Profile WWW
« Reply #1 on: January 22, 2010, 05:20:25 PM »

Really nice! I just got my sheevaplug and quicly installed my Google xmpp bot with a Google Voice class to SMS and notify by phone calls.
I have been running bots with the smack xmpp library for a while, the only problem is that once in a while i will get kicked out by an unhandled exception when parsing an invalid packets date. Have you run into this problem? I haven't had time to find the bug and recompile the lib. Let me know if run into this problem.

-Noel
Logged

ryanm
Newbie
*

Karma: 0
Posts: 3


View Profile
« Reply #2 on: January 23, 2010, 02:57:50 AM »

I have had an uncaught exception from one the smack threads, but it's only happened the once so I haven't investigated very far. I've added more error logging now, but assuming that fixing the exception is too much work, I'll probably just wrap the whole thing in a persistence layer, i.e.: Start the sage in it's own process and watch the err printstream for exceptions being printed, and then just restarting the whole thing. There's no important state being preserved in the sage, so it's no problem just to kill and restart the process.
Logged

Pages: [1]
Print
Jump to: