home *** CD-ROM | disk | FTP | other *** search
/ Chip 2011 November / CHIP_2011_11.iso / Programy / Narzedzia / Calibre / calibre-0.8.18.msi / file_280 / slashdot.recipe < prev    next >
Text File  |  2011-09-09  |  2KB  |  53 lines

  1. #!/usr/bin/env python
  2. # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
  3. from __future__ import with_statement
  4.  
  5. __license__   = 'GPL v3'
  6. __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net> edited by Huan T'
  7.  
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class Slashdot(BasicNewsRecipe):
  11.     title          = u'Slashdot.org'
  12.     description    = '''Tech news. WARNING: This recipe downloads a lot
  13.     of content and may result in your IP being banned from slashdot.org'''
  14.     oldest_article = 7
  15.     simultaneous_downloads = 1
  16.     delay = 3
  17.     max_articles_per_feed = 100
  18.     language = 'en'
  19.  
  20.     __author__ = 'floweros edited by Huan T'
  21.     no_stylesheets = True
  22.     keep_only_tags = [
  23.         dict(name='div',attrs={'id':'article'}),
  24.         dict(name='div',attrs={'class':['postBody' 'details']}),
  25.         dict(name='footer',attrs={'class':['clearfix meta article-foot']}),
  26.         dict(name='article',attrs={'class':['fhitem fhitem-story article usermode thumbs grid_24']}),
  27.         dict(name='dl',attrs={'class':'relatedPosts'}),
  28.         dict(name='h2',attrs={'class':'story'}),
  29.         dict(name='span',attrs={'class':'comments'}),
  30.         ]
  31.  
  32.  
  33.     remove_tags    = [
  34.         dict(name='aside',attrs={'id':'slashboxes'}),
  35.         dict(name='div',attrs={'class':'paginate'}),
  36.         dict(name='section',attrs={'id':'comments'}),
  37.         dict(name='span',attrs={'class':'topic'}),
  38.         ]
  39.  
  40.     feeds          = [
  41.                  (u'Slashdot',
  42.  u'http://rss.slashdot.org/Slashdot/slashdot'),
  43.                  (u'/. IT',
  44.  u'http://rss.slashdot.org/Slashdot/slashdotIT'),
  45.                  (u'/. Hardware',
  46.  u'http://rss.slashdot.org/Slashdot/slashdotHardware'),
  47.                  (u'/. Linux',
  48.  u'http://rss.slashdot.org/Slashdot/slashdotLinux'),
  49.                  (u'/. Your Rights Online',
  50.  u'http://rss.slashdot.org/Slashdot/slashdotYourRightsOnline')
  51.                  ]
  52.  
  53.