add export_thread

add export_thread to boobmsg

working show_thread
This commit is contained in:
Juke 2011-02-11 00:06:35 +01:00
commit fe7b8d082c
3 changed files with 29 additions and 5 deletions

View file

@ -18,11 +18,15 @@
import re
def id2url(_id):
regexp2 = re.compile("(\w+).(\w+).(.*$)")
regexp2 = re.compile("(\w+).([0-9]+).(.*$)")
match = regexp2.match(_id)
return 'http://www.20minutes.fr/%s/%s/%s' % ( match.group(1),
match.group(2),
match.group(3))
if match:
return 'http://www.20minutes.fr/%s/%s/%s' % ( match.group(1),
match.group(2),
match.group(3))
else:
raise ValueError("id doesn't match")
def url2id(url):
regexp = re.compile("http://www.20minutes.fr/(\w+)/([0-9]+)/(.*$)")
match = regexp.match(url)