Skip to content

Commit

Permalink
The oblique services manifest changed location, updated to follow.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean B. Palmer committed Nov 6, 2010
1 parent 331bc44 commit 63b981c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ ci: ;
log: ;
# git log --date=short --format='%h %ad %s'
git graph

sync: ;
rsync -avz --delete ./ pubble:opt/phenny/
11 changes: 10 additions & 1 deletion modules/oblique.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
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'<[^>]+>')
Expand Down Expand Up @@ -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()

0 comments on commit 63b981c

Please sign in to comment.