diff --git a/local/bin/mangahere_rss.py b/local/bin/mangahere_rss.py new file mode 100755 index 0000000..edb9c80 --- /dev/null +++ b/local/bin/mangahere_rss.py @@ -0,0 +1,44 @@ +#!/usr/bin/python + +from pyquery import PyQuery as pq +from pprint import pprint +import sys + +ITEM = """ + + {title} + {description} + {link} +""" + +class Release(object): + + def __init__(self, title, link): + self.title = title + self.link = link + + def __str__(self): + return ITEM.format( + title=self.title, + description="New release: {}".format(self.title), + link=self.link) + + def __contains__(self, string): + return string in self.title or string in self.link + +latest = pq(url="http://www.mangahere.co/latest/") + +print("""\ + + +""") + +for item in map(pq, latest("dd > a")): + release = Release(item.attr("title"), item.attr("href")) + if any(word in release for word in sys.argv): + print(str(release)) + +print(""" + + +""")