diff options
author | cedricbonhomme <devnull@localhost> | 2010-03-24 19:57:29 +0100 |
---|---|---|
committer | cedricbonhomme <devnull@localhost> | 2010-03-24 19:57:29 +0100 |
commit | 3d221ff5a460af1c0b24f904b8dc3419497d8397 (patch) | |
tree | 70a6ea89d2930317e222cb2f15850631cdaca4df | |
parent | Minor bug fix in URL. (diff) | |
download | newspipe-3d221ff5a460af1c0b24f904b8dc3419497d8397.tar.gz newspipe-3d221ff5a460af1c0b24f904b8dc3419497d8397.tar.bz2 newspipe-3d221ff5a460af1c0b24f904b8dc3419497d8397.zip |
Improvement. HTML tags (of feed and article title) are now removed before insertion in the SQLite base.
-rwxr-xr-x | feedgetter.py | 4 | ||||
-rwxr-xr-x | pyAggr3g470r.py | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/feedgetter.py b/feedgetter.py index 70883ed5..3dbe2e4c 100755 --- a/feedgetter.py +++ b/feedgetter.py @@ -100,7 +100,7 @@ class FeedGetter(object): feed_image = "/css/img/feed-icon-28x28.png" try: self.c.execute('insert into feeds values (?,?,?,?,?)', (\ - a_feed.feed.title.encode('utf-8'), \ + utils.remove_html_tags(a_feed.feed.title.encode('utf-8')), \ a_feed.feed.link.encode('utf-8'), \ feed_link, \ feed_image, @@ -117,7 +117,7 @@ class FeedGetter(object): try: self.c.execute('insert into articles values (?,?,?,?,?,?)', (\ datetime(*article.updated_parsed[:6]), \ - article.title.encode('utf-8'), \ + utils.remove_html_tags(article.title.encode('utf-8')), \ article.link.encode('utf-8'), \ description, \ "0", \ diff --git a/pyAggr3g470r.py b/pyAggr3g470r.py index a364f76c..86ddffdc 100755 --- a/pyAggr3g470r.py +++ b/pyAggr3g470r.py @@ -89,7 +89,7 @@ class Root: target="_blank"><img src="%s" width="28" height="28" /></a></h2>\n""" % \ (rss_feed_id, \ self.feeds[rss_feed_id][5].encode('utf-8'), \ - utils.remove_html_tags(self.feeds[rss_feed_id][3].encode('utf-8')), \ + self.feeds[rss_feed_id][3].encode('utf-8'), \ self.feeds[rss_feed_id][4].encode('utf-8'), \ self.feeds[rss_feed_id][2].encode('utf-8')) @@ -107,8 +107,7 @@ class Root: html += article[1].encode('utf-8') + \ " - " + not_read_begin + \ """<a href="/description/%s:%s" rel="noreferrer" target="_blank">%s</a>""" % \ - (rss_feed_id, article[0].encode('utf-8'), \ - utils.remove_html_tags(article[2].encode('utf-8'))) + \ + (rss_feed_id, article[0].encode('utf-8'), article[2].encode('utf-8')) + \ not_read_end + \ "<br />\n" html += "<br />\n" |