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

  1. #!/usr/bin/env  python
  2. __license__     = 'GPL v3'
  3. __author__      = 'Lorenzo Vigentini'
  4. __copyright__   = '2009, Lorenzo Vigentini <l.vigentini at gmail.com>'
  5. __version__     = 'v1.01'
  6. __date__        = '13, January 2010'
  7. __description__ = 'PCMag (www.pcmag.com) delivers authoritative, labs-based comparative reviews of computing and Internet products to highly engaged technology buyers.'
  8.  
  9. '''
  10. http://www.pcmag.com/
  11. '''
  12. import re
  13. from calibre.web.feeds.news import BasicNewsRecipe
  14. from calibre.ebooks.BeautifulSoup import Comment
  15.  
  16. class pcMag(BasicNewsRecipe):
  17.     __author__     = 'Lorenzo Vigentini'
  18.     description    = 'PCMag (www.pcmag.com) delivers authoritative, labs-based comparative reviews of computing and Internet products to highly engaged technology buyers.'
  19.  
  20.     cover_url      = 'http://www.pcmag.com/images/bg-logo-sharp.2.gif'
  21.     title          = 'PC Magazine'
  22.     publisher      = 'Ziff Davis Media'
  23.     category       = 'PC, computing, product reviews'
  24.  
  25.     language       = 'en'
  26.     encoding       = 'cp1252'
  27.     timefmt        = '[%a, %d %b, %Y]'
  28.  
  29.     oldest_article        = 15
  30.     max_articles_per_feed = 25
  31.     use_embedded_content  = False
  32.     recursion             = 10
  33.  
  34.     remove_javascript     = True
  35.     no_stylesheets = True
  36.  
  37.  
  38.     feeds          = [
  39.                        (u'Tech Commentary from the Editors of PC Magazine', u'http://rssnewsapps.ziffdavis.com/PCMAG_commentary.xml'),
  40.                        (u'PC Magazine Breaking News', u'http://rssnewsapps.ziffdavis.com/pcmagtips.xml'),
  41.                        (u'PC Magazine Tips and Solutions', u'http://rssnewsapps.ziffdavis.com/pcmagofficetips.xml'),
  42.                        (u'PC Magazine Small Business', u'http://blogs.pcmag.com/atwork/index.xml'),
  43.                        (u'PC Magazine Security Watch', u'http://feeds.ziffdavis.com/ziffdavis/securitywatch?format=xml'),
  44.                        (u'PC Magazine: the Official John C. Dvorak RSS Feed', u'http://rssnewsapps.ziffdavis.com/PCMAG_dvorak.xml'),
  45.                        (u'PC Magazine Editor-in-Chief Lance Ulanoff', u'http://rssnewsapps.ziffdavis.com/pcmagulanoff.xml'),
  46.                        (u'Michael Millers Forward Thinking from PCMag.com', u'http://feeds.ziffdavis.com/ziffdavis/pcmag-miller?format=xml'),
  47.                        (u'Technology News from Ziff Davis', u'http://rssnewsapps.ziffdavis.com/pcmagbreakingnews.xml')
  48.                      ]
  49.  
  50.     keep_only_tags = [dict(attrs={'class':'content-page'})]
  51.     remove_tags         = [
  52.                             dict(attrs={'class':['control-side','comment','highlights_content','btn-holder','subscribe-panel',
  53.                                 'grey-box comments-box']}),
  54.                             dict(id=['inlineDigg']),
  55.                             dict(text=lambda text:isinstance(text, Comment)),
  56.                             dict(name='img', width='1'),
  57.                         ]
  58.     preprocess_regexps = [(re.compile(r"<img '[^']+?'"), lambda m : '<img ')]
  59.  
  60.