home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / calibre-0.7.13.msi / file_4064 < prev    next >
Encoding:
Text File  |  2010-07-17  |  1.7 KB  |  45 lines

  1. import string
  2. from calibre.web.feeds.news import BasicNewsRecipe
  3.  
  4. class TechnologyReview(BasicNewsRecipe):
  5.     title          = u'Technology Review'
  6.     __author__ = 'rty'
  7.     description = 'MIT Technology Magazine'
  8.     publisher = 'Technology Review Inc.'
  9.     category = 'Technology, Innovation, R&D'
  10.     oldest_article = 14
  11.     max_articles_per_feed = 100
  12.     No_stylesheets = True
  13.     extra_css = """
  14.     .ArticleBody {font: normal; text-align: justify}
  15.     .headline {font: bold x-large}
  16.     .subheadline {font: italic large}
  17.     """
  18.     feeds = [
  19.     (u'Computing', u'http://feeds.technologyreview.com/technology_review_Computing'),
  20.     (u'Web', u'http://feeds.technologyreview.com/technology_review_Web'),
  21.     (u'Communications', u'http://feeds.technologyreview.com/technology_review_Communications'),
  22.     (u'Energy', u'http://feeds.technologyreview.com/technology_review_Energy'),
  23.     (u'Materials', u'http://feeds.technologyreview.com/technology_review_Materials'),
  24.     (u'Biomedicine', u'http://feeds.technologyreview.com/technology_review_Biotech'),
  25.     (u'Business', u'http://feeds.technologyreview.com/technology_review_Biztech')
  26.     ]
  27.     remove_attributes = ['width', 'align','cellspacing']
  28.  
  29.     remove_tags = [
  30.                     dict(name='div', attrs={'id':['CloseLink','footerAdDiv','copyright']}),
  31.                          ]
  32.     remove_tags_after = [dict(name='div', attrs={'id':'copyright'})]
  33.  
  34.     def get_article_url(self, article):
  35.         return article.get('guid', article.get('id', None))
  36.  
  37.  
  38.     def print_version(self, url):
  39.         baseurl='http://www.technologyreview.com/printer_friendly_article.aspx?id='
  40.         split1 = string.split(url,"/")
  41.         xxx=split1 [4]
  42.         split2= string.split(xxx,"/")
  43.         s =  baseurl + split2[0]
  44.         return s
  45.