mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-01-25 19:44:13 +01:00
Fix for slashdot bug, I think.
This commit is contained in:
parent
9a907277c1
commit
85807dd077
@ -159,11 +159,16 @@ class RSS(callbacks.Privmsg):
|
|||||||
oldheadlines = []
|
oldheadlines = []
|
||||||
newresults = self.getFeed(url)
|
newresults = self.getFeed(url)
|
||||||
newheadlines = self.getHeadlines(newresults)
|
newheadlines = self.getHeadlines(newresults)
|
||||||
for headline in oldheadlines:
|
def headlineEq(h1, h2):
|
||||||
|
return h1.lower().split() == h2.lower().split()
|
||||||
|
for (i, oldheadline) in enumerate(oldheadlines):
|
||||||
try:
|
try:
|
||||||
newheadlines.remove(headline)
|
newheadline = newheadlines[i]
|
||||||
except ValueError:
|
except IndexError:
|
||||||
pass
|
break
|
||||||
|
if headlineEq(oldheadline, newheadline):
|
||||||
|
newheadlines[i] = None
|
||||||
|
newheadlines = filter(None, newheadlines) # Removes Nones.
|
||||||
if newheadlines:
|
if newheadlines:
|
||||||
for channel in channels:
|
for channel in channels:
|
||||||
bold = self.registryValue('bold', channel)
|
bold = self.registryValue('bold', channel)
|
||||||
|
@ -44,6 +44,8 @@ if network:
|
|||||||
|
|
||||||
def testRss(self):
|
def testRss(self):
|
||||||
self.assertNotError('rss %s' % url)
|
self.assertNotError('rss %s' % url)
|
||||||
|
m = self.assertNotError('rss %s' % url)
|
||||||
|
self.failUnless(m.args[1].count('||') == 1)
|
||||||
|
|
||||||
def testRssAdd(self):
|
def testRssAdd(self):
|
||||||
self.assertNotError('rss add advogato %s' % url)
|
self.assertNotError('rss add advogato %s' % url)
|
||||||
|
Loading…
Reference in New Issue
Block a user