From 4cdf013c14da32220c462464baaa0d04697c54da Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Tue, 8 Apr 2003 07:52:24 +0000 Subject: [PATCH] Improved formatting of headlines. --- plugins/RSS.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/RSS.py b/plugins/RSS.py index 991d870b7..ba5c26dfe 100644 --- a/plugins/RSS.py +++ b/plugins/RSS.py @@ -73,6 +73,7 @@ def configure(onStart, afterConnect, advanced): name = anything('What\'s the name of the website?') url = anything('What\'s the URL of the RSS feed?') onStart.append('alias %s "rsstitles %s"' % (name, url)) + onStart.append('freeze %s' % name) class RSS(callbacks.Privmsg): @@ -91,7 +92,8 @@ class RSS(callbacks.Privmsg): now = time.time() if url not in self.lastRequest or now - self.lastRequest[url] > 1800: results = rssparser.parse(url) - headlines = [d['title'] for d in results['items']] + headlines = [d['title'].strip().replace('\n', ' ') \ + for d in results['items']] while reduce(operator.add, map(len, headlines), 0) > 350: headlines.pop() if not headlines: