From c8dead0929ea053f00deeb309d59bee839c8b093 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 17 May 2012 09:46:41 +1200 Subject: [PATCH 1/5] Updated date on copyright/typos and shit --- README.md | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 4b0a733..d797171 100755 --- a/README.md +++ b/README.md @@ -98,9 +98,9 @@ The developers of CloudBot run two CloudBots on [Espernet](http://esper.net). They can both be found in [#CloudBot](irc://irc.esper.net/cloudbot "Connect via IRC to #CloudBot on irc.esper.net). -**mau5bot** is the stable bot, and runs on the latest release version of CloudBot. (mau5bot is running on **Ubuntu Server** *Oneric Ocelot/11.10* with **Python** *2.7.2*) +**mau5bot** is the semi-stable bot, and runs on the latest stable development version of CloudBot. (mau5bot is running on **Ubuntu Server** *Oneric Ocelot/11.10* with **Python** *2.7.2*) -**neerbot** is the unstable bot, and runs on the latest development² version of CloudBot. (neerbot is running on **Debian** *Wheezy/Testing* with **Python** *2.7.2*) +**neerbot** is the unstable bot, and runs on the latest(ish) development version of CloudBot. (neerbot is running on **Debian** *Wheezy/Testing* with **Python** *2.7.2*) ## Requirements @@ -117,7 +117,7 @@ CloudBot is **licensed** under the **GPL v3** license. The terms are as follows. CloudBot/DEV - Copyright © 2011 ClouDev - <[cloudev.github.com](http://cloudev.github.com)> + Copyright © 2011-2012 Luke Rogers / ClouDev - <[cloudev.github.com](http://cloudev.github.com)> CloudBot is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -134,8 +134,4 @@ CloudBot is **licensed** under the **GPL v3** license. The terms are as follows. ## Notes -¹ if you prefer to run the bot with a custom backend/run it manually, or are on **Windows**, run the bot with `./bot.py` - -² or whatever version [neersighted](http://git.io/neersighted) is currently hacking on - ³ eventually From 9035be2ed49e41364cbe9d7ed99e54539aa53a9d Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 17 May 2012 09:48:28 +1200 Subject: [PATCH 2/5] Removed un-needed libs --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index d797171..d2ecfd2 100755 --- a/README.md +++ b/README.md @@ -106,11 +106,11 @@ They can both be found in [#CloudBot](irc://irc.esper.net/cloudbot "Connect via CloudBot runs on **Python** *2.7.x*. It is developed on **Debian** *Wheezy/Testing* and **Ubuntu** *11.10* with **Python** *2.7.2*. -It **requires Python modules** `lXML`, `BeautifulSoup`, `Enchant`, `psutil`, and `HTTPlib2`. +It **requires Python modules** `lXML`, `BeautifulSoup` and `Enchant`, `psutil`, and `HTTPlib2`. -The programs `screen` or `daemon` are recomended for the wrapper to run optimaly. +The programs `daemon` or `screen` are recomended for the wrapper to run optimaly. -**Windows** users: Windows compatibility with the wrapper and some plugins is **broken** (such as the ping), but we do intend to add it.³ +**Windows** users: Windows compatibility with the wrapper and some plugins is **broken** (such as ping), but we do intend to add it.³ ## License CloudBot is **licensed** under the **GPL v3** license. The terms are as follows. From a822b4f61ab0f1389e704dd9f1baddaeb91cc981 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 17 May 2012 11:17:38 +1200 Subject: [PATCH 3/5] Changed soem strings --- disabled_plugins/suggest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/disabled_plugins/suggest.py b/disabled_plugins/suggest.py index 75cdaa8..92f9405 100755 --- a/disabled_plugins/suggest.py +++ b/disabled_plugins/suggest.py @@ -15,7 +15,7 @@ def suggest(inp, inp_unstripped=''): num, inp = m.groups() num = int(num) if num > 10: - return 'can only get first ten suggestions' + return 'I can only get the first ten suggestions.' else: num = 0 @@ -23,10 +23,10 @@ def suggest(inp, inp_unstripped=''): page_json = page.split('(', 1)[1][:-1] suggestions = json.loads(page_json)[1] if not suggestions: - return 'no suggestions found' + return 'No suggestions found.' if num: if len(suggestions) + 1 <= num: - return 'only got %d suggestions' % len(suggestions) + return 'I only got %d suggestions.' % len(suggestions) out = suggestions[num - 1] else: out = random.choice(suggestions) From a2bfaf6ca55fbf30bd25b2ed15d3f26b1859483e Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 17 May 2012 11:45:07 +1200 Subject: [PATCH 4/5] Tweaked a few things --- plugins/twitter.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/plugins/twitter.py b/plugins/twitter.py index 2cad245..b20d7a1 100755 --- a/plugins/twitter.py +++ b/plugins/twitter.py @@ -1,13 +1,12 @@ # written by Scaevolus, modified by Lukeroge +from util import hook, http + import random import re -from time import strftime -from time import strptime +from time import strftime, strptime from datetime import datetime -from util import hook -from util import http -from util import timesince +from util.timesince import timesince def unescape_xml(string): @@ -109,20 +108,20 @@ def twitter(inp): try: tweet = http.get_xml(url) - except http.HTTPError, e: + except http.HTTPError as e: errors = {400: 'bad request (ratelimited?)', - 401: 'tweet is private', - 403: 'tweet is private', - 404: 'invalid user/id', - 500: 'twitter is broken', - 502: 'twitter is down ("getting upgraded")', - 503: 'twitter is overloaded (lol, RoR)'} + 401: 'tweet is private', + 403: 'tweet is private', + 404: 'invalid user/id', + 500: 'twitter is broken', + 502: 'twitter is down ("getting upgraded")', + 503: 'twitter is overloaded (lol, RoR)'} if e.code == 404: return 'error: invalid ' + ['username', 'tweet id'][getting_id] if e.code in errors: return 'error: ' + errors[e.code] return 'error: unknown %s' % e.code - except http.URLError, e: + except http.URLError as e: return 'error: timeout' if searching_hashtag: @@ -153,7 +152,7 @@ def twitter(inp): strptime(time.text, '%a %b %d %H:%M:%S +0000 %Y')) - time_nice = timesince.timesince(parseDateTime(time_raw), datetime.utcnow()) + time_nice = timesince(parseDateTime(time_raw), datetime.utcnow()) if tweet.find(retweeted_text) is not None: text = 'RT @%s:' % tweet.find(retweeted_screen_name).text From 9c27f3ac067823bf8ab2c8b353788bb6e697f269 Mon Sep 17 00:00:00 2001 From: Luke Rogers Date: Thu, 17 May 2012 11:52:31 +1200 Subject: [PATCH 5/5] Moar tweakage --- plugins/twitter.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/plugins/twitter.py b/plugins/twitter.py index b20d7a1..d798e12 100755 --- a/plugins/twitter.py +++ b/plugins/twitter.py @@ -6,6 +6,7 @@ import random import re from time import strftime, strptime from datetime import datetime + from util.timesince import timesince @@ -46,8 +47,8 @@ def parseDateTime(s): @hook.command def twitter(inp): - "twitter / //#/@ -- Gets last/th "\ - "tweet from /gets tweet /Gets random tweet with #/"\ + "twitter / //#/@ -- Gets last/th " \ + "tweet from /gets tweet /Gets random tweet with #/" \ "gets replied tweet from @." def add_reply(reply_name, reply_id): @@ -104,25 +105,25 @@ def twitter(inp): url = 'http://search.twitter.com/search.atom?q=%23' + inp[1:] searching_hashtag = True else: - return 'error: invalid request' + return 'Error: Invalid request.' try: tweet = http.get_xml(url) except http.HTTPError as e: - errors = {400: 'bad request (ratelimited?)', - 401: 'tweet is private', - 403: 'tweet is private', - 404: 'invalid user/id', - 500: 'twitter is broken', - 502: 'twitter is down ("getting upgraded")', - 503: 'twitter is overloaded (lol, RoR)'} + errors = {400: 'Bad request (ratelimited?)', + 401: 'Tweet is private', + 403: 'Tweet is private', + 404: 'Invalid user/id', + 500: 'Twitter is broken', + 502: 'Twitter is down ("getting upgraded")', + 503: 'Twitter is overloaded'} if e.code == 404: return 'error: invalid ' + ['username', 'tweet id'][getting_id] if e.code in errors: - return 'error: ' + errors[e.code] - return 'error: unknown %s' % e.code + return 'Error: %s.' % errors[e.code] + return 'Unknown Error: %s' % e.code except http.URLError as e: - return 'error: timeout' + return 'Error: Request timed out.' if searching_hashtag: ns = '{http://www.w3.org/2005/Atom}'