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

  1. #!/usr/bin/env  python
  2.  
  3. __license__   = 'GPL v3'
  4. __copyright__ = '2008, Darko Miletic <darko.miletic at gmail.com>'
  5. '''
  6. sciencemag.org
  7. '''
  8. from calibre.web.feeds.news import BasicNewsRecipe
  9.  
  10. class ScienceAAS(BasicNewsRecipe):
  11.     title                 = u'Science AAAS'
  12.     __author__            = u'Darko Miletic'
  13.     language = 'en'
  14.  
  15.     description           = u'The best in science news, commentary, and research'
  16.     oldest_article        = 7
  17.     max_articles_per_feed = 100
  18.     no_stylesheets        = True
  19.     use_embedded_content  = False
  20.     simultaneous_downloads = 1
  21.     delay                  = 1
  22.     timefmt                = ' [%A, %d %B, %Y]'
  23.     needs_subscription     = True
  24.     LOGIN = 'http://www.sciencemag.org/cgi/login?uri=%2Findex.dtl'
  25.  
  26.     def get_browser(self):
  27.         br = BasicNewsRecipe.get_browser()
  28.         if self.username is not None and self.password is not None:
  29.             br.open(self.LOGIN)
  30.             br.select_form(name='registered_users_form')
  31.             br['username'] = self.username
  32.             br['code'    ] = self.password
  33.             br.submit()
  34.         return br
  35.  
  36.     keep_only_tags = [ dict(name='div', attrs={'id':'LegacyContent'}) ]
  37.  
  38.     feeds       = [(u"Science: Current Issue", u'http://www.sciencemag.org/rss/current.xml')]
  39.