home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_3668 < prev    next >
Encoding:
Text File  |  2010-01-16  |  5.9 KB  |  92 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__        = '14, January 2010'
  7. __description__ = 'Computeractive publishes new downloads, reviews, news stories, step-by-step guides and answers to PC problems every day.'
  8.  
  9. '''
  10. http://www.computeractive.co.uk/
  11. '''
  12.  
  13. from calibre.web.feeds.news import BasicNewsRecipe
  14.  
  15. class computeractive(BasicNewsRecipe):
  16.     __author__    = 'Lorenzo Vigentini'
  17.     description   = 'Computeractive publishes new downloads, reviews, news stories, step-by-step guides and answers to PC problems every day.'
  18.     cover_url     = 'http://images.pcworld.com/images/common/header/header-logo.gif'
  19.  
  20.     title          = 'Computer act!ve'
  21.     publisher      = 'Incisive media'
  22.     category       = 'PC, video, computing, product reviews, editing, cameras, production'
  23.  
  24.     language       = 'en'
  25.     timefmt        = '[%a, %d %b, %Y]'
  26.  
  27.     oldest_article        = 7
  28.     max_articles_per_feed = 25
  29.     use_embedded_content  = False
  30.     recursion             = 10
  31.  
  32.     remove_javascript     = True
  33.     no_stylesheets        = True
  34.  
  35.     keep_only_tags     = [
  36.                             dict(name='div', attrs={'id':'main'})
  37.                         ]
  38.  
  39.     remove_tags        = [
  40.                             dict(name='div', attrs={'id':['seeAlsoTags','commentsModule','relatedArticles','mainLeft','mainRight']}),
  41.                             dict(name='div', attrs={'class':['buyIt','detailMpu']}),
  42.                             dict(name='a', attrs={'class':'largerImage'})
  43.                         ]
  44.  
  45.     feeds          = [
  46.                        (u'General content', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/all'),
  47.                        (u'News', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/news'),
  48.                        (u'Downloads', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/downloads'),
  49.                        (u'Hardware', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/hardware'),
  50.                        (u'Software', u'http://feeds.computeractive.co.uk/rss/latest/computeractive/software'),
  51.                        (u'Competitions', u'http://www.v3.co.uk/feeds/rss20/personal-technology/competitions')
  52.                      ]
  53.  
  54.  
  55.     extra_css = '''
  56.                 h1 {font-family:Arial,Helvetica,sans-serif; font-size:20px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold;}
  57.                 h2 {font-family:Arial,Helvetica,sans-serif; font-size:18px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold; }
  58.                 h3 {color:#333333;font-family:Arial,Helvetica,sans-serif; font-size:16px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold;}
  59.                 h4 {color:#333333; font-family:Arial,Helvetica,sans-serif;font-size:14px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold;}
  60.                 h5 {color:#333333; font-family:Arial,Helvetica,sans-serif; font-size:12px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:bold;text-transform:uppercase;}
  61.                 .newsdate {color:#333333;font-family:Arial,Helvetica,sans-serif;font-size:10px; font-size-adjust:none; font-stretch:normal; font-style:italic; font-variant:normal; font-weight:bold; line-height:10px; text-decoration:none;}
  62.                 .author {color:#333333;font-family:Arial,Helvetica,sans-serif;font-size:10px; font-size-adjust:none; font-stretch:normal; font-style:bold; font-variant:normal; font-weight:bold; line-height:10px; text-decoration:none;}
  63.                 p {font-family:"Trebuchet MS",Arial,Helvetica,sans-serif; font-size:10px;}
  64.                 .breadcrumbs {margin:0 0 0.6em 0;font-family:"Trebuchet MS",Arial,Helvetica,sans-serif; font-size:8px;}
  65.                 #breadcrumbsLeft {width:360px; }
  66.                 .breadcrumbs ul {color:#999; display:inline; margin:1em 0 0 0; padding:0; list-style:none; }
  67.                 .breadcrumbs li { display:inline; }
  68.                 .breadcrumbs a:link, .breadcrumbs a:visited { color:#999; text-decoration:none; }
  69.                 .breadcrumbs a:hover, .breadcrumbs a:active { color:#999; text-decoration:underline; }
  70.                 #postHeader #reviewDetails { padding-left: 0px; }
  71.                 #reviewDetails { float:left; margin:0 0 0 10px; padding:0; width:574px; border-top:1px dotted #0071BC; }
  72.             #reviewDetails div { margin:0; padding:0; }
  73.         #reviewDetailsLeft { float:left; width:334px; margin:0 10px 0 0; padding:0; }
  74.         #reviewDetailsRight { float:right; width:230px; margin:0; padding:0; }
  75.             #reviewDetails div h2 { font-size:1.2em; float:none; margin:0.5em 0 0.5em 0; padding:0; }
  76.         #reviewDetails #verdict { width:334px; float:left; margin:0; padding:0; }
  77.         #reviewDetails #ratings, #reviewDetails #price { width:230px; float:left; margin:0; padding:0; }
  78.         #reviewDetails #ratings img { border:0; margin:0; padding:0; }
  79.         #verdict p strong { width:334px; float:left; margin:0 0 0.25em; padding:0; }
  80.         #verdict ul { width:334px; float:left; margin:0; padding:0; }
  81.         #verdict li { width:334px; float:left; list-style:none; clear:left; margin:0 4px 0.3em 0px; padding:0 0 0 12px;}
  82.         html > body #verdict li { width:322px; }
  83.                 #post { margin-bottom:2em; clear:both; }
  84.                 #post .content p { margin:1em 0; line-height:1.5em; }
  85.                 #post p a:link { color:#005599; text-decoration:none; font-weight:bold; }
  86.                 #post p a:hover, #post p a:active { color:#cc0000; text-decoration:underline; }
  87.                 #post p a:visited { color:#003366; text-decoration:none; font-weight:bold; }
  88.                 #postHeader .author { font-weight:normal; margin:1em 8px 0.25em 0; }
  89.                 #postHeader .postMetaData { color:#666; margin:0 8px 0 0; }
  90.                 '''
  91.  
  92.