Fix #1058840 (Updated recipe for Twitch films)

This commit is contained in:
Kovid Goyal 2012-09-30 09:03:56 +05:30
parent 0720d2ed74
commit b4d4133c6d

View File

@ -1,5 +1,5 @@
__license__ = 'GPL v3'
__copyright__ = '2009-2011, Darko Miletic <darko.miletic at gmail.com>'
__copyright__ = '2009-2012, Darko Miletic <darko.miletic at gmail.com>'
'''
twitchfilm.net/news/
'''
@ -13,10 +13,8 @@ class Twitchfilm(BasicNewsRecipe):
max_articles_per_feed = 100
no_stylesheets = True
use_embedded_content = False
auto_cleanup = True
encoding = 'utf-8'
publisher = 'Twitch'
masthead_url = 'http://twitchfilm.com/img/logo.png'
category = 'twitch, twitchfilm, movie news, movie reviews, cult cinema, independent cinema, anime, foreign cinema, geek talk'
language = 'en'
@ -27,18 +25,18 @@ class Twitchfilm(BasicNewsRecipe):
, 'language' : language
}
#keep_only_tags=[dict(attrs={'class':'asset-header'})]
#remove_tags_after=dict(attrs={'class':'asset-body'})
#remove_tags = [ dict(name='div', attrs={'class':['social','categories']})
#, dict(attrs={'id':'main-asset'})
#, dict(name=['meta','link','iframe','embed','object'])
#]
keep_only_tags=[dict(attrs={'class':'entry'})]
remove_tags_after=dict(attrs={'class':'text'})
remove_tags = [ dict(name='div', attrs={'class':['social','categories']})
, dict(attrs={'id':'main-asset'})
, dict(name=['meta','link','iframe','embed','object'])
]
feeds = [(u'News', u'http://feeds.twitchfilm.net/TwitchEverything')]
def preprocess_html(self, soup):
for item in soup.findAll(style=True):
del item['style']
del item['style']
for item in soup.findAll('a'):
limg = item.find('img')
if item.string is not None: