aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcedricbonhomme <devnull@localhost>2010-07-08 13:24:07 +0200
committercedricbonhomme <devnull@localhost>2010-07-08 13:24:07 +0200
commitfb350e5cd91380b86fe9c355299e4fda2b3ee1d4 (patch)
treeef9c2b2890699771cb6e74e3fc05548dd41fbe31
parentAdded cross.png (diff)
downloadnewspipe-fb350e5cd91380b86fe9c355299e4fda2b3ee1d4.tar.gz
newspipe-fb350e5cd91380b86fe9c355299e4fda2b3ee1d4.tar.bz2
newspipe-fb350e5cd91380b86fe9c355299e4fda2b3ee1d4.zip
Release 1.6. It is now possible to automatically add a feed (with the URL of the site), delete an article,delete a feed with all its articles and to delete all articles from the database. There is also some nice improvements to the side of performance (management page, tag clouds generation), tested with more than 3000 articles. Furthermore, a better HTML export of all the articles of the database. You can also export the articles in raw text. And finally some minor bugfix.
-rwxr-xr-xpyAggr3g470r.py20
-rwxr-xr-xutils.py16
-rwxr-xr-xvar/feed.lst3
3 files changed, 31 insertions, 8 deletions
diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py
index 8bf78c05..4b361465 100755
--- a/pyAggr3g470r.py
+++ b/pyAggr3g470r.py
@@ -2,8 +2,8 @@
#-*- coding: utf-8 -*-
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 1.5 $"
-__date__ = "$Date: 2010/07/05 $"
+__version__ = "$Revision: 1.6 $"
+__date__ = "$Date: 2010/07/08 $"
__copyright__ = "Copyright (c) 2010 Cedric Bonhomme"
__license__ = "GPLv3"
@@ -212,7 +212,7 @@ class Root:
html += """<form method=get action="/fetch/">\n<input
type="submit" value="Fetch all feeds"></form>\n"""
- html += """<form method=get action="/add_feed/">\n<input
+ html += """<form method=get action="/drop_base">\n<input
type="submit" value="Delete all articles"></form>\n"""
html += "<h1>Export articles</h1>"
html += """<form method=get action="/export/"><select name="export_method">\n"""
@@ -814,6 +814,16 @@ class Root:
delete_article.exposed = True
+ def drop_base(self):
+ """
+ Delete all articles
+ """
+ utils.drop_base()
+ return self.management()
+
+ drop_base.exposed = True
+
+
def export(self, export_method):
"""
Export articles stored in the SQLite database in text files.
@@ -905,8 +915,8 @@ class Root:
try:
print "Watching %s" % utils.sqlite_base
while True:
- time.sleep(2)
- # very simple test
+ time.sleep(1)
+ # simple test (date of last modification: getmtime)
if os.path.getmtime(utils.sqlite_base) != old_time:
print "The base of feeds (%s) has changed.\nReloading..." % utils.sqlite_base
self.update()
diff --git a/utils.py b/utils.py
index a6822685..7a9d7f81 100755
--- a/utils.py
+++ b/utils.py
@@ -2,8 +2,8 @@
#-*- coding: utf-8 -*-
__author__ = "Cedric Bonhomme"
-__version__ = "$Revision: 0.8 $"
-__date__ = "$Date: 2010/07/05 $"
+__version__ = "$Revision: 0.9 $"
+__date__ = "$Date: 2010/07/08 $"
__copyright__ = "Copyright (c) 2010 Cedric Bonhomme"
__license__ = "GPLv3"
@@ -219,6 +219,18 @@ def create_base():
conn.commit()
c.close()
+def drop_base():
+ """
+ Delete all articles from the database.
+ """
+ sqlite3.register_adapter(str, lambda s : s.decode('utf-8'))
+ conn = sqlite3.connect(sqlite_base, isolation_level = None)
+ c = conn.cursor()
+ c.execute('''DROP TABLE IF EXISTS feeds''')
+ c.execute('''DROP TABLE IF EXISTS articles''')
+ conn.commit()
+ c.close()
+
def load_feed():
"""
Load feeds and articles in a dictionary.
diff --git a/var/feed.lst b/var/feed.lst
index fbee3acf..82d77e09 100755
--- a/var/feed.lst
+++ b/var/feed.lst
@@ -14,7 +14,6 @@ http://feeds.feedburner.com/internetactu/bcmJ
http://www.april.org/fr/rss.xml
http://www.framablog.org/index.php/feed/atom
http://tarekziade.wordpress.com/feed/
-http://www.le-tigre.net/spip.php?page=backend
http://formats-ouverts.org/rss.php
http://lwn.net/headlines/newrss
http://kernelnewbies.org/RecentChanges?action=rss_rc&ddiffs=1&unique=1
@@ -26,3 +25,5 @@ http://static.fsf.org/fsforg/rss/blogs.xml
http://esr.ibiblio.org/?feed=rss2
http://www.maitre-eolas.fr/feed/atom
http://linuxfr.org/backend/journaux/rss20.rss
+http://www.zooomr.com/services/feeds/public_photos/?id=28230@Z01&format=rss_200
+http://www.le-tigre.net/spip.php?page=backend
bgstack15