fix parsing of username in comments

This commit is contained in:
Romain Bignon 2011-03-08 12:34:51 +01:00
commit 406475d7b9

View file

@ -48,7 +48,7 @@ class Comment(object):
self.username = None self.username = None
else: else:
self.author = unicode(a.text) self.author = unicode(a.text)
self.username = unicode(a.attrib['href'].lstrip('/users/')) self.username = unicode(a.attrib['href'].split('/')[2])
self.date = datetime.strptime(select(div.find('p'), 'time', 1).attrib['datetime'].split('+')[0], self.date = datetime.strptime(select(div.find('p'), 'time', 1).attrib['datetime'].split('+')[0],
'%Y-%m-%dT%H:%M:%S') '%Y-%m-%dT%H:%M:%S')
self.date = local2utc(self.date) self.date = local2utc(self.date)