import re from calibre.web.feeds.news import BasicNewsRecipe class Reuters(BasicNewsRecipe): title = 'Reuters' description = 'Global news' __author__ = 'Kovid Goyal and Sujata Raman' use_embedded_content = False language = 'en' max_articles_per_feed = 10 no_stylesheets = True remove_javascript = True extra_css = ''' body{font-family:arial,helvetica,sans;} h1{ font-size:larger ; font-weight:bold; } .byline{color:#006E97;font-size:x-small; font-weight:bold;} .location{font-size:x-small; font-weight:bold;} .timestamp{font-size:x-small; } ''' keep_only_tags = [dict(name='div', attrs={'class':'column2 gridPanel grid8'})] remove_tags = [dict(name='div', attrs={'id':['recommendedArticles','relatedNews','relatedVideo','relatedFactboxes']}), dict(name='p', attrs={'class':['relatedTopics']}), dict(name='a', attrs={'id':['fullSizeLink']}), dict(name='div', attrs={'class':['photoNav','relatedTopicButtons','articleComments','gridPanel grid8','footerHalf gridPanel grid1','gridPanel grid2','gridPanel grid3']}),] preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in [ ##(r'
.*?' , lambda match : ''), (r'