summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean B. Palmer <sbp@aldebaran.local>2010-11-06 12:09:03 +0000
committerSean B. Palmer <sbp@aldebaran.local>2010-11-06 12:09:03 +0000
commit63b981c994f2b41a9fcee003b7418f3cb10ba6a4 (patch)
treebe7a22e9a3bb37439b76f1ffce402edf036482fe
parent331bc44338eb7062f83c884f97d92482043168cb (diff)
downloadbot-63b981c994f2b41a9fcee003b7418f3cb10ba6a4.tar.gz
bot-63b981c994f2b41a9fcee003b7418f3cb10ba6a4.tar.bz2
bot-63b981c994f2b41a9fcee003b7418f3cb10ba6a4.zip
The oblique services manifest changed location, updated to follow.
-rw-r--r--Makefile3
-rwxr-xr-xmodules/oblique.py11
2 files changed, 13 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index c53623a..75636b5 100644
--- a/Makefile
+++ b/Makefile
@@ -13,3 +13,6 @@ ci: ;
log: ;
# git log --date=short --format='%h %ad %s'
git graph
+
+sync: ;
+ rsync -avz --delete ./ pubble:opt/phenny/
diff --git a/modules/oblique.py b/modules/oblique.py
index e1ae299..b19cb50 100755
--- a/modules/oblique.py
+++ b/modules/oblique.py
@@ -10,7 +10,7 @@ http://inamidst.com/phenny/
import re, urllib
import web
-definitions = 'http://github.com/nslater/oblique/wiki'
+definitions = 'https://github.com/nslater/oblique/wiki'
r_item = re.compile(r'(?i)<li>(.*?)</li>')
r_tag = re.compile(r'<[^>]+>')
@@ -91,5 +91,14 @@ def py(phenny, input):
service(phenny, input, 'py', input.group(2))
py.commands = ['py']
+def snippet(phenny, input):
+ py = "BeautifulSoup.BeautifulSoup(re.sub('<.*?>|(?<= ) +', '', " + \
+ "eval(urllib.urlopen('http://ajax.googleapis.com/ajax/serv" + \
+ "ices/search/web?v=1.0&q=" + urllib.quote(input.group(2)) + \
+ "').read().replace('null', 'None'))['responseData']['resul" + \
+ "ts'][0]['content'].decode('unicode-escape')), convertEntities=True)"
+ service(phenny, input, 'py', py)
+snippet.commands = ['snippet']
+
if __name__ == '__main__':
print __doc__.strip()