From dd6ab0957f37f54e60372b5b24c742627fe2f8e4 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 28 Nov 2008 11:20:11 -0800 Subject: [PATCH] Added recipe for Security Watch (thanks to Oliver) --- src/calibre/ebooks/metadata/opf2.py | 2 +- src/calibre/web/feeds/recipes/__init__.py | 2 +- .../web/feeds/recipes/security_watch.py | 31 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 src/calibre/web/feeds/recipes/security_watch.py diff --git a/src/calibre/ebooks/metadata/opf2.py b/src/calibre/ebooks/metadata/opf2.py index 2d2703c799..be99bb8332 100644 --- a/src/calibre/ebooks/metadata/opf2.py +++ b/src/calibre/ebooks/metadata/opf2.py @@ -984,4 +984,4 @@ def main(args=sys.argv): if __name__ == '__main__': - sys.exit(test()) + sys.exit(main()) diff --git a/src/calibre/web/feeds/recipes/__init__.py b/src/calibre/web/feeds/recipes/__init__.py index 7b3a1844ab..257adab5c8 100644 --- a/src/calibre/web/feeds/recipes/__init__.py +++ b/src/calibre/web/feeds/recipes/__init__.py @@ -15,7 +15,7 @@ recipe_modules = [ 'demorgen_be', 'de_standaard', 'ap', 'barrons', 'chr_mon', 'cnn', 'faznet', 'jpost', 'jutarnji', 'nasa', 'reuters', 'spiegelde', 'wash_post', 'zeitde', 'blic', 'novosti', 'danas', 'vreme', 'times_online', 'the_scotsman', - 'nytimes_sub' + 'nytimes_sub', 'security_watch' ] import re, imp, inspect, time, os diff --git a/src/calibre/web/feeds/recipes/security_watch.py b/src/calibre/web/feeds/recipes/security_watch.py new file mode 100644 index 0000000000..846e429c5d --- /dev/null +++ b/src/calibre/web/feeds/recipes/security_watch.py @@ -0,0 +1,31 @@ +from calibre.web.feeds.news import BasicNewsRecipe + +class SecurityWatch(BasicNewsRecipe): + title = u'securitywatch' + description = 'security news' + timefmt = ' [%d %b %Y]' + __author__ = 'Oliver' + no_stylesheets = True + oldest_article = 14 + max_articles_per_feed = 100 + use_embedded_content = False + filter_regexps = [r'feedads\.googleadservices\.com'] + filter_regexps = [r'ad\.doubleclick'] + filter_regexps = [r'advert'] + + remove_tags = [dict(id='topBannerContainer'), + dict(id='topBannerSmall'), + dict(id='topSearchBar'), + dict(id='topSearchForm'), + dict(id='rtBannerMPU'), + dict(id='topNavBar'), + dict(id='breadcrumbs'), + #dict(id='entry-28272'), + dict(id='topSearchLinks'), + dict(name='span', attrs={'class':'date'})] + + remove_tags_after = [dict(id='googlemp')] + + feeds = [(u'securitywatch', u'http://feeds.ziffdavisenterprise.com/RSS/security_watch/')] + +