Fixed formatting.

This commit is contained in:
Fletcher Boyd 2013-09-04 18:30:04 +08:00
parent 146ae3c279
commit 4069dd21a3
89 changed files with 615 additions and 496 deletions

View file

@ -3,9 +3,9 @@ import re
reddit_re = (r'.*((www\.)?reddit\.com/r[^ ]+)', re.I)
@hook.regex(*reddit_re)
def reddit_url(match):
thread = http.get_html(match.group(0))
title = thread.xpath('//title/text()')[0]
@ -16,4 +16,4 @@ def reddit_url(match):
comments = thread.xpath("//div[@id='siteTable']//a[@class='comments']/text()")[0]
return '\x02%s\x02 - posted by \x02%s\x02 %s ago - %s upvotes, %s downvotes - %s' % (
title, author, timeago, upvotes, downvotes, comments)
title, author, timeago, upvotes, downvotes, comments)