calibre/recipes/endgadget_ja.recipe
Hiroshi Miura 521a8f93c1 update japanese recipes
- update:
  endgaget jp
  Kahoku Shinpo
  MSN Sankei News
  Uni no Himitsu
- remove problematic recipes:
  nikkei_sub*
  chou chou blog

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
2014-05-06 17:16:20 +09:00

43 lines
1.6 KiB
Plaintext

__license__ = 'GPL v3'
__copyright__ = '2010,2014, Hiroshi Miura <miurahr@linux.com>'
'''
japan.engadget.com
'''
from calibre.web.feeds.news import BasicNewsRecipe
class EndgadgetJapan(BasicNewsRecipe):
title = u'Endgadget\u65e5\u672c\u7248'
language = 'ja'
__author__ = 'Hiroshi Miura'
cover_url = 'http://skins18.wincustomize.com/1/49/149320/29/7578/preview-29-7578.jpg'
masthead_url = 'http://www.blogsmithmedia.com/japanese.engadget.com/media/eng-jp-logo-t.png'
oldest_article = 7
max_articles_per_feed = 100
no_stylesheets = True
language = 'ja'
encoding = 'utf-8'
index = 'http://japanese.engadget.com/'
remove_javascript = True
remove_tags_before = dict(name="header", attrs={'class':"header"})
remove_tags_after = dict(name='div', attrs={'class':'post-meta'})
def parse_index(self):
feeds = []
newsarticles = []
soup = self.index_to_soup(self.index)
for topstories in soup.findAll('header',attrs={'class':'post-header'}):
itt = topstories.find('h2')
itema = itt.find('a',href=True)
itemtime = topstories.find('span',attrs={'class':'time'})
newsarticles.append({
'title' :itema.string
,'date' :itemtime.string
,'url' :itema['href']
,'description':''
})
feeds.append(('Latest Posts', newsarticles))
return feeds