import re import string class LrytasLT(BasicNewsRecipe): title = u'LrytasLT' author = 'st. modest' oldest_article = 7 max_articles_per_feed = 100 no_stylesheets = True encoding = 'utf-8' feeds = [ (u'LrytasLT', u'http://www.lrytas.lt/rss/'), (u'Aktualijos', u'http://www.lrytas.lt/rss/?tema=1'), (u'Kultura', u'http://www.lrytas.lt/rss/?tema=9'), (u'Emigrantai', u'http://www.lrytas.lt/rss/?tema=37'), (u'Auto', u'http://www.lrytas.lt/rss/?tema=27'), (u'Mokslas', u'http://www.lrytas.lt/rss/?tema=15'), (u'Istorija', u'http://www.lrytas.lt/rss/?tema=10'), ] def print_version(self, url): m = re.search('-(\d*)-', url) ret = "http://www.lrytas.lt/print.asp?k=news&id=" + string.strip(m.group(0), "-") return ret