mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 18:54:09 -04:00
New recipe for Twitch films by Darko Miletic
This commit is contained in:
parent
1118d338e0
commit
8ca336696b
@ -105,7 +105,7 @@ def debug_device_driver():
|
|||||||
prefix = logical_disk.DeviceID+os.sep
|
prefix = logical_disk.DeviceID+os.sep
|
||||||
drives.append((str(drive.PNPDeviceID), drive.Index, prefix))
|
drives.append((str(drive.PNPDeviceID), drive.Index, prefix))
|
||||||
except IndexError:
|
except IndexError:
|
||||||
drives.append(str(drive.PNPDeviceID))
|
drives.append((str(drive.PNPDeviceID), 'No mount points found'))
|
||||||
for drive in drives:
|
for drive in drives:
|
||||||
print '\t', drive
|
print '\t', drive
|
||||||
from calibre.devices import devices
|
from calibre.devices import devices
|
||||||
|
@ -40,7 +40,7 @@ recipe_modules = ['recipe_' + r for r in (
|
|||||||
'krstarica', 'krstarica_en', 'tanjug', 'laprensa_ni', 'azstarnet',
|
'krstarica', 'krstarica_en', 'tanjug', 'laprensa_ni', 'azstarnet',
|
||||||
'corriere_della_sera_it', 'corriere_della_sera_en', 'msdnmag_en',
|
'corriere_della_sera_it', 'corriere_della_sera_en', 'msdnmag_en',
|
||||||
'moneynews', 'der_standard', 'diepresse', 'nzz_ger', 'hna',
|
'moneynews', 'der_standard', 'diepresse', 'nzz_ger', 'hna',
|
||||||
'seattle_times', 'scott_hanselman', 'coding_horror',
|
'seattle_times', 'scott_hanselman', 'coding_horror', 'twitchfilms',
|
||||||
'stackoverflow', 'telepolis_artikel', 'zaobao', 'usnews',
|
'stackoverflow', 'telepolis_artikel', 'zaobao', 'usnews',
|
||||||
)]
|
)]
|
||||||
|
|
||||||
|
41
src/calibre/web/feeds/recipes/recipe_twitchfilms.py
Normal file
41
src/calibre/web/feeds/recipes/recipe_twitchfilms.py
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
__license__ = 'GPL v3'
|
||||||
|
__copyright__ = '2009, Darko Miletic <darko.miletic at gmail.com>'
|
||||||
|
'''
|
||||||
|
twitchfilm.net/site/
|
||||||
|
'''
|
||||||
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
||||||
|
|
||||||
|
class Twitchfilm(BasicNewsRecipe):
|
||||||
|
title = 'Twitch Films'
|
||||||
|
__author__ = 'Darko Miletic'
|
||||||
|
description = 'Twitch specializes in spreading the news on strange little films from around the world.'
|
||||||
|
oldest_article = 30
|
||||||
|
max_articles_per_feed = 100
|
||||||
|
no_stylesheets = True
|
||||||
|
use_embedded_content = True
|
||||||
|
encoding = 'utf-8'
|
||||||
|
publisher = 'Twitch'
|
||||||
|
category = 'twitch, twitchfilm, movie news, movie reviews, cult cinema, independent cinema, anime, foreign cinema, geek talk'
|
||||||
|
language = _('English')
|
||||||
|
|
||||||
|
html2lrf_options = [
|
||||||
|
'--comment', description
|
||||||
|
, '--category', category
|
||||||
|
, '--publisher', publisher
|
||||||
|
]
|
||||||
|
|
||||||
|
html2epub_options = 'publisher="' + publisher + '"\ncomments="' + description + '"\ntags="' + category + '"'
|
||||||
|
|
||||||
|
remove_tags = [dict(name='div', attrs={'class':'feedflare'})]
|
||||||
|
|
||||||
|
feeds = [(u'News', u'http://feedproxy.google.com/TwitchEverything')]
|
||||||
|
|
||||||
|
def preprocess_html(self, soup):
|
||||||
|
mtag = Tag(soup,'meta',[('http-equiv','Content-Type'),('context','text/html; charset=utf-8')])
|
||||||
|
soup.head.insert(0,mtag)
|
||||||
|
soup.html['lang'] = 'en-US'
|
||||||
|
return soup
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user