X-Git-Url: https://jfr.im/git/z_archive/twitter.git/blobdiff_plain/c8d451e84b52bff57d38c9c6bcfcb4ab21281db6..b0dedfc018d4a0ecb9defa60969fb472e188a990:/twitter/ircbot.py diff --git a/twitter/ircbot.py b/twitter/ircbot.py index fb14c11..a10a5f1 100644 --- a/twitter/ircbot.py +++ b/twitter/ircbot.py @@ -26,7 +26,7 @@ password: If no config file is given "twitterbot.ini" will be used by default. """ -BOT_VERSION = "TwitterBot 0.5.1 (http://mike.verdone.ca/twitter)" +BOT_VERSION = "TwitterBot 1.0 (http://mike.verdone.ca/twitter)" IRC_BOLD = chr(0x02) IRC_ITALIC = chr(0x16) @@ -241,24 +241,24 @@ def load_config(filename): cp.read((filename,)) # attempt to read these properties-- they are required - self.config.get('twitter', 'email'), - self.config.get('twitter', 'password') - self.config.get('irc', 'server') - self.config.getint('irc', 'port') - self.config.get('irc', 'nick') + cp.get('twitter', 'email'), + cp.get('twitter', 'password') + cp.get('irc', 'server') + cp.getint('irc', 'port') + cp.get('irc', 'nick') + cp.get('irc', 'channel') return cp - -# Howdy, hacker!! You've found the secret Twitter business model!! -# -# 1. provide awesome status-update service -# 2. buy a lot of new hardware to keep it running -# 3. ??? -# 4. profit! +# So there was a joke here about the twitter business model +# but I got rid of it. Not because I want this codebase to +# be "professional" in any way, but because someone forked +# this and deleted the comment because they couldn't take +# a joke. Hi guy! # -# I'm just kidding... :3 - +# Fact: The number one use of Google Code is to look for that +# comment in the Linux kernel that goes "FUCK me gently with +# a chainsaw." Pretty sure Linus himself wrote it. def main(): configFilename = "twitterbot.ini" @@ -269,10 +269,11 @@ def main(): if not os.path.exists(configFilename): raise Exception() load_config(configFilename) - except: + except Exception, e: print >> sys.stderr, "Error while loading ini file %s" %( configFilename) - print __doc__ + print >> sys.stderr, e + print >> sys.stderr, __doc__ sys.exit(1) bot = TwitterBot(configFilename)