]> kaliko git repositories - sid.git/commitdiff
Fixed xhtml-im formating in Feeds
authorkaliko <kaliko@azylum.org>
Sun, 16 Nov 2014 15:46:19 +0000 (16:46 +0100)
committerkaliko <kaliko@azylum.org>
Sun, 16 Nov 2014 16:00:20 +0000 (17:00 +0100)
sid/feeds.py

index b3dd19f43147d857cd8f68930e4f3ef998c521e3..dd3c78116361e50ac0b217d12644b6b68ca32250 100644 (file)
@@ -64,7 +64,7 @@ class FeedMonitor(threading.Thread):
 
         # unusual return http code
         if parsed_feed.status != 200:
-            self.plugin.log.error(
+            self.plugin.log.warning(
                 'Got code %(status)d from "%(href)s" (please update).' %
                     parsed_feed)
             return
@@ -99,14 +99,14 @@ class FeedMonitor(threading.Thread):
             body = '%(title)s %(link)s' % post
             text.append(body)
 
-            xpost = dict(**post)
-            xpost['title'] = html_escape(xpost.get('title', 'n/a'))
-            xbody = '<a href="%(link)s">%(title)s</a>' % xpost
+            xpost = {'title': html_escape(post.get('title', 'n/a'))}
+            xpost['link'] = html_escape(post.get('link',))
+            xbody = '<a href="{link}">{title}</a>'.format(**xpost)
             xhtml.append(xbody)
         # Updating self.seen
         self.seen[feed_id] = entries
         if len(text) > 1:
-            self.plugin.send({'mbody':'<br />'.join(xhtml), 'mhtml':'\n'.join(text)})
+            self.plugin.send({'mhtml':'<br />'.join(xhtml), 'mbody':'\n'.join(text)})
 
     def run(self):
         while not self.thread_killed: