From 5618d8036be2b70f8774e4e0c2e62afc66d458ee Mon Sep 17 00:00:00 2001 From: wsuetholz Date: Sat, 13 Nov 2010 23:30:47 -0600 Subject: [PATCH] MediaMiner was not sending the date with the correct timezone info, so strip it off. We don't need the time anyways. --- mediaminer.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mediaminer.py b/mediaminer.py index 77ff29bd..e8389abc 100644 --- a/mediaminer.py +++ b/mediaminer.py @@ -167,7 +167,7 @@ class MediaMiner(FanfictionSiteAdapter): self.genre = '' td_smtxt = soup.findAll('td') if td_smtxt is None: - logging.debug('td_smtxt is NONE!') + #logging.debug('td_smtxt is NONE!') pass else: ll = len(td_smtxt) @@ -248,8 +248,12 @@ class MediaMiner(FanfictionSiteAdapter): self.storyDescription = sst.strip() logging.debug('self.storyDescription=%s' % self.storyDescription) elif ssbt == 'Latest Revision:' or ssbt == 'Uploaded On:': - logging.debug('sst=%s' % sst) - self.storyUpdated = datetime.datetime.fromtimestamp(time.mktime(time.strptime(sst.strip(' '), "%B %d, %Y %H:%M %Z"))) + #logging.debug('sst=%s' % sst) + ssts = sst.split(' ') + if ssts is not None and len(ssts) > 3: + sst = ssts[0] + ' ' + ssts[1] + ' ' + ssts[2] + #logging.debug('sst=%s' % sst) + self.storyUpdated = datetime.datetime.fromtimestamp(time.mktime(time.strptime(sst.strip(' '), "%B %d, %Y"))) logging.debug('self.storyUpdated=%s' % self.storyUpdated) else: pass