View Single Post
Old 04-04-2011, 06:16 PM   #6
louhike
Junior Member
louhike began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Apr 2011
Device: Kindle 3
I've come to this code :
Code:
class AdvancedUserRecipe1301947892(BasicNewsRecipe):
    title          = u'Security RSSs'
    description = u'News from various websites about security'
    timefmt = ' [%a, %d %b, %Y]'
    encoding = 'ISO-8859-1'
    oldest_article = 7
    max_articles_per_feed = 100
    no_stylesheets = True
    use_embedded_content   = False
    language = 'en_EN'
    remove_javascript = True
    keep_only_tags = [dict(name='div', attrs={'class':['post',
                                                       'modSectionTd2',
                                                       'narrowcolumn',
                                                       'content',
                                                       'entry',
                                                       'post',
                                                       'hfeed',
                                                       'entry-content']}),
                        dict(name='div',attrs={'id':['container']})]
    remove_tags = [dict(name='p', attrs={'class':['small',
                                                  'metadata alt',
                                                  'postmetadata alt',
                                                  'insider_continue']}),
                   dict(name='div', attrs={'class':['nocomments',
                                                    'comment-navigation',
                                                    'topsy_widget_data topsy_theme_silver',
                                                    'socialtitlesingle',
                                                    'navigation',
                                                    'greeting',
                                                    'snap_nopreview sharing robots-nocontent',
                                                    'entry-utility',
                                                    'nav-below',
                                                    'related-posts',
                                                    'prev_next post_nav',
                                                    'action_fb',
                                                    'comments_link',
                                                    'title_bar',
                                                    'comment',
                                                    'comments',
                                                    'related-posts'
                                                    'widget-area']}),
                   dict(name='div',attrs={'id':['respond',
                                                'greet_block',
                                                'entry-author-info',
                                                'idc-container-parent',
                                                'idc-loading-comments',
                                                'idc-noscript',
                                                'comments']}),
                   dict(name='span', attrs={'class':['tags']}),
                   dict(name='h3', attrs={'id':['comments']}),
                   dict(name='ol',attrs={'class':['commentlist']}),
                   dict(name='ul',attrs={'class':['term_list']})]

    feeds          = [(u'MailsChannel', u'feeds.feedburner.com/MailChannelsBlog'),
                      (u'F-Secure', u'http://www.f-secure.com/weblog/weblog.rss'),
                      (u'Marshal TRACE News','labs.m86security.com/feed/'),
                      (u'Krebs on security','feeds.feedburner.com/KrebsOnSecurity'),
                      (u'Securosis','securosis.com/feeds/blog'),
                      (u'Sunblet Blog','http://feeds.feedburner.com/SunbeltBlog'),
                      (u'TrendLabs','http://feeds.trendmicro.com/Anti-MalwareBlog'),
                      (u'Sophos (Naked Security)','http://feeds.feedburner.com/nakedsecurity'),
                      (u'Richi\'s Blog','blog.richi.co.uk/feeds/posts/default'),
                      (u'Matt Cutts Blog','http://feeds.mattcutts.com/mattcutts/uJBW?format=xml')]
I might improve it in the future because it takes undesired tags for Sophos. Otherwise, it works quite well.
louhike is offline   Reply With Quote