diff options
author | cedricbonhomme <devnull@localhost> | 2010-01-30 13:33:18 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-01-30 13:33:18 +0100 |
commit | f57d9256d642a8f10d710451b3c607e913118c28 (patch) | |
tree | d17429771b3dcbcaded7f3724dd5968cc3e25c5e /feedgetter.py | |
parent | Downloading of informations feeds and the update of base are asynchronous. Us... (diff) | |
download | newspipe-f57d9256d642a8f10d710451b3c607e913118c28.tar.gz newspipe-f57d9256d642a8f10d710451b3c607e913118c28.tar.bz2 newspipe-f57d9256d642a8f10d710451b3c607e913118c28.zip |
All date are parsed into the standard Python datetime format.
Diffstat (limited to 'feedgetter.py')
-rw-r--r-- | feedgetter.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/feedgetter.py b/feedgetter.py index a51515fe..8c2d6e4c 100644 --- a/feedgetter.py +++ b/feedgetter.py @@ -12,6 +12,8 @@ import sqlite3 import threading import feedparser +from datetime import datetime + url_finders = [ \ re.compile("([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}|(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+)(:[0-9]*)?/[-A-Za-z0-9_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\),\\\"]"), \ re.compile("([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}|(((news|telnet|nttp|file|http|ftp|https)://)|(www|ftp)[-A-Za-z0-9]*\\.)[-A-Za-z0-9\\.]+)(:[0-9]*)?"), \ @@ -84,7 +86,7 @@ class FeedGetter(object): for article in a_feed['entries']: try: self.c.execute('insert into rss_feed values (?,?,?,?,?)', (\ - "-".join([str(i) for i in list(article.updated_parsed)]), \ + datetime(*article.updated_parsed[:6]), \ a_feed.feed.title.encode('utf-8'), \ a_feed.feed.link.encode('utf-8'), \ article.title.encode('utf-8'), \ |