From ca03c63fcd56da659cdb019fbdbde9877e9a26a8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 15 Jun 2012 19:37:57 +0530 Subject: [PATCH] Huffington Post UK by Krittika Goyal --- recipes/huffingtonpost_uk.recipe | 47 ++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 recipes/huffingtonpost_uk.recipe diff --git a/recipes/huffingtonpost_uk.recipe b/recipes/huffingtonpost_uk.recipe new file mode 100644 index 0000000000..92e941de5e --- /dev/null +++ b/recipes/huffingtonpost_uk.recipe @@ -0,0 +1,47 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class HindustanTimes(BasicNewsRecipe): + title = u'Huffington Post UK' + language = 'en_GB' + __author__ = 'Krittika Goyal' + oldest_article = 2 #days + max_articles_per_feed = 25 + #encoding = 'cp1252' + use_embedded_content = False + + no_stylesheets = True + auto_cleanup = True + auto_cleanup_keep = '//div[@class="articleBody"]' + + feeds = [ +('UK Politics', + 'http://www.huffingtonpost.com/feeds/verticals/uk-politics/news.xml'), +('UK Entertainment', + 'http://www.huffingtonpost.com/feeds/verticals/uk-entertainment/news.xml'), +('UK Style', + 'http://www.huffingtonpost.com/feeds/verticals/uk-style/news.xml'), +('UK Fashion:', + 'http://www.huffingtonpost.com/feeds/verticals/uk-fashion/news.xml'), +('UK Universities:', + 'http://www.huffingtonpost.com/feeds/verticals/uk-universities-education/news.xml'), +('UK World', + 'http://www.huffingtonpost.com/feeds/verticals/uk-world/news.xml'), +('UK Lifestyle', + 'http://www.huffingtonpost.com/feeds/verticals/uk-lifestyle/news.xml'), +('UK Comedy', + 'http://www.huffingtonpost.com/feeds/verticals/uk-comedy/news.xml'), +('UK Celebrity', + 'http://www.huffingtonpost.com/feeds/verticals/uk-celebrity/news.xml'), +('UK Culture', + 'http://www.huffingtonpost.com/feeds/verticals/uk-culture/news.xml'), +('UK News', + 'http://www.huffingtonpost.com/feeds/verticals/uk/news.xml'), +('UK Tech', + 'http://www.huffingtonpost.com/feeds/verticals/uk-tech/news.xml'), +('UK Sport', + 'http://www.huffingtonpost.com/feeds/verticals/uk-sport/news.xml'), + ] + def get_article_url(self, entry): + if entry.links: + return entry.links[0]['href'] + return BasicNewsRecipe.get_article_url(self, entry)