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

  1. from calibre.web.feeds.news import BasicNewsRecipe
  2.  
  3.  
  4. class NBOnline(BasicNewsRecipe):
  5.     title          = u'Nikkei Business Online'
  6.     language = 'ja'
  7.     description = u'Nikkei Business Online.\u6CE8\uFF1A\u30E6\u30FC\u30B6\u30FC\u540D\u306Bemail\u30A2\u30C9\u30EC\u30B9\u3068\u30E6\u30FC\u30B6\u30FC\u540D\u3092\u30BB\u30DF\u30B3\u30ED\u30F3\u3067\u533A\u5207\u3063\u3066\u5165\u308C\u3066\u304F\u3060\u3055\u3044\u3002\u4F8B\uFF1Aemail@address.jp;username . PLEASE NOTE: You need to put your email address and username into username filed separeted by ; (semi-colon).'
  8.     __author__    = 'Ado Nishimura'
  9.     needs_subscription = True
  10.     oldest_article = 7
  11.     max_articles_per_feed = 100
  12.     remove_tags_before = dict(id='kanban')
  13.     remove_tags = [dict(name='div', id='footer')]
  14.  
  15.     feeds          = [('Nikkei Buisiness Online', 'http://business.nikkeibp.co.jp/rss/all_nbo.rdf')]
  16.  
  17.     def get_cover_url(self):
  18.         return 'http://business.nikkeibp.co.jp/images/nbo/200804/parts/logo.gif'
  19.  
  20.     def get_browser(self):
  21.         br = BasicNewsRecipe.get_browser()
  22.         if self.username is not None and self.password is not None:
  23.             br.open('https://signon.nikkeibp.co.jp/front/login/?ct=p&ts=nbo')
  24.             br.select_form(name='loginActionForm')
  25.             br['email']   = self.username.split(';')[0]
  26.             br['userId']   = self.username.split(';')[1]
  27.             br['password'] = self.password
  28.             br.submit()
  29.         return br
  30.  
  31.     def print_version(self, url):
  32.         return url + '?ST=print'
  33.