diff options
author | cedricbonhomme <devnull@localhost> | 2011-04-15 19:42:35 +0200 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2011-04-15 19:42:35 +0200 |
commit | 657b2336256428e6d55cc8a3fd5713e51e8dc35b (patch) | |
tree | ad7adb970a6138fd6c6225d48a4ece5dcbd34223 /utils.py | |
parent | Added picture for Diaspora. (diff) | |
download | newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.tar.gz newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.tar.bz2 newspipe-657b2336256428e6d55cc8a3fd5713e51e8dc35b.zip |
Added a new form in the management page in order to set the number of articles load by feed to be loaded.
Diffstat (limited to 'utils.py')
-rwxr-xr-x | utils.py | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -67,6 +67,8 @@ smtp_server = config.get('mail','smtp') username = config.get('mail','username') password = config.get('mail','password') +MAX_NB_ARTICLES = -1 + # regular expression to chech URL 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_\\$\\.\\+\\!\\*\\(\\),;:@&=\\?/~\\#\\%]*[^]'\\.}>\\),\\\"]"), \ @@ -372,7 +374,7 @@ def load_feed(): if list_of_articles != []: list_of_articles.sort(lambda x,y: compare(y[0], x[0])) # Walk through the list of articles for the current feed. - for article in list_of_articles: + for article in list_of_articles[:MAX_NB_ARTICLES]: sha1_hash.update(article[2].encode('utf-8')) article_id = sha1_hash.hexdigest() |