From c79327b13344e6ab150cd46062def77cf839bf86 Mon Sep 17 00:00:00 2001 From: cedricbonhomme Date: Wed, 9 Jun 2010 13:38:16 +0200 Subject: It is now possible to add a feed just with the URL of the web page via the management page. The URL of the feed is obtained by parsing the web page with the module BeautifulSoup. There is therefore no need to edit the file feed.lst by hand. --- pyAggr3g470r.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'pyAggr3g470r.py') diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index 00987cda..4145bc99 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -182,8 +182,8 @@ class Root: html += htmlnav html += """
\n""" html += "

Add Feeds

\n" - html += """
\n
\n""" + html += """
\n
\n""" if self.articles: html += "

Delete Feeds

\n" @@ -747,6 +747,32 @@ class Root: list_favorites.exposed = True + def add_feed(self, url): + """ + Add a new feed with the URL of a page. + """ + html = htmlheader + html += htmlnav + html += """
""" + # search the feed in the HTML page with BeautifulSoup + feed_url = utils.search_feed(url) + # if a feed exists + if feed_url is not None: + result = utils.add_feed(feed_url) + # if the feed is not already in the file feed.lst + if result is False: + html += "

You are already following this feed!

" + else: + html += """

Feed added. You can now fetch your feeds.

""" + html += "
" + html += """Back to the management page.
\n""" + html += "
\n" + html += htmlfooter + return html + + add_feed.exposed = True + + def export(self, export_method): """ Export articles stored in the SQLite database in text files. -- cgit