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

  1. __license__   = 'GPL v3'
  2. __copyright__ = '2010, Hiroshi Miura <miurahr@linux.com>'
  3. '''
  4. www.jiji.com
  5. '''
  6.  
  7. from calibre.web.feeds.news import BasicNewsRecipe
  8.  
  9. class JijiDotCom(BasicNewsRecipe):
  10.     title          = u'\u6642\u4e8b\u901a\u4fe1'
  11.     __author__     = 'Hiroshi Miura'
  12.     description    = 'World News from Jiji Press'
  13.     publisher      = 'Jiji Press Ltd.'
  14.     category       = 'news'
  15.     oldest_article = 6
  16.     max_articles_per_feed = 100
  17.     encoding       = 'euc_jisx0213'
  18.     language       = 'ja'
  19.     masthead_url   = 'http://jen.jiji.com/images/logo_jijipress.gif'
  20.     top_url        = 'http://www.jiji.com/'
  21.  
  22.     feeds          = [(u'\u30cb\u30e5\u30fc\u30b9', u'http://www.jiji.com/rss/ranking.rdf')]
  23.     remove_tags_after = dict(id="ad_google")
  24.  
  25.     def get_cover_url(self):
  26.         cover_url       = 'http://www.jiji.com/img/top_header_logo2.gif'
  27.         soup = self.index_to_soup(self.top_url)
  28.         cover_item = soup.find('div', attrs={'class':'top-pad-photos'})
  29.         if cover_item:
  30.             cover_url = self.top_url + cover_item.img['src']
  31.         return cover_url
  32.