mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Update Private Eye
This commit is contained in:
parent
29f11510e2
commit
c7d84b206d
BIN
recipes/icons/private_eye.png
Normal file
BIN
recipes/icons/private_eye.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
@ -1,31 +1,38 @@
|
|||||||
|
import re
|
||||||
|
|
||||||
from calibre.web.feeds.news import BasicNewsRecipe
|
from calibre.web.feeds.news import BasicNewsRecipe
|
||||||
|
|
||||||
class AdvancedUserRecipe1359406781(BasicNewsRecipe):
|
class AdvancedUserRecipe1359406781(BasicNewsRecipe):
|
||||||
title = u'Private Eye'
|
title = u'Private Eye'
|
||||||
oldest_article = 15
|
publication_type = 'magazine'
|
||||||
|
description = u'Private Eye is a fortnightly British satirical and current affairs magazine, edited by Ian Hislop'
|
||||||
|
oldest_article = 13
|
||||||
max_articles_per_feed = 100
|
max_articles_per_feed = 100
|
||||||
remove_empty_feeds = True
|
remove_empty_feeds = True
|
||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
ignore_duplicate_articles = {'title'}
|
ignore_duplicate_articles = {'title'}
|
||||||
language = 'en_GB'
|
language = 'en_GB'
|
||||||
__author__ = 'Martyn Pritchard'
|
|
||||||
encoding = 'iso-8859-1'
|
encoding = 'iso-8859-1'
|
||||||
compress_news_images = True
|
__author__ = u'MartynPritchard@yahoo.com'
|
||||||
compress_news_images_auto_size = 8
|
__copyright__ = '2014, Martyn Pritchard <MartynPritchard@yahoo.com>'
|
||||||
scale_news_images_to_device = False
|
|
||||||
scale_news_images = (220, 300)
|
|
||||||
|
|
||||||
def get_cover_url(self):
|
def get_cover_url(self):
|
||||||
soup = self.index_to_soup('http://www.private-eye.co.uk')
|
cover_url = None
|
||||||
cov = soup.find(attrs={'width' : '180', 'border' : '0'})
|
soup = self.index_to_soup('http://www.private-eye.co.uk/current_issue.php')
|
||||||
cover_url = 'http://www.private-eye.co.uk/'+cov['src']
|
for citem in soup.findAll('img'):
|
||||||
|
if citem['src'].endswith('big.jpg'):
|
||||||
|
return 'http://www.private-eye.co.uk/' + citem['src']
|
||||||
return cover_url
|
return cover_url
|
||||||
|
|
||||||
keep_only_tags = [dict(name='table', attrs={'width':['100%'], 'border':['0'], 'align': ['center'], 'cellspacing':['0'], 'cellpadding':['0']}),
|
remove_tags_before = {'class':"sub_dave"}
|
||||||
dict(name='table', attrs={'width':['480'], 'cellspacing':['0'], 'cellpadding':['0']}),
|
remove_tags = [dict(name='td', attrs={'class':'sub_dave'})]
|
||||||
dict(name='table', attrs={'width':['490'], 'border':['0'], 'align': ['left'], 'cellspacing':['0'], 'cellpadding':['1']}),
|
|
||||||
dict(name='table', attrs={'width':['500'], 'cellspacing':['0'], 'cellpadding':['0']}),
|
preprocess_regexps = [
|
||||||
|
(re.compile(r'../grfx', re.DOTALL|re.IGNORECASE), lambda match: 'http://www.private-eye.co.uk/grfx'),
|
||||||
|
(re.compile(r'More From This Issue.*</body>', re.DOTALL|re.IGNORECASE), lambda match: '</body>'),
|
||||||
|
(re.compile(r'More top stories in the latest issue:.*</body>', re.DOTALL|re.IGNORECASE), lambda match: '</body>'),
|
||||||
|
(re.compile(r'Also Available Online.*</body>', re.DOTALL|re.IGNORECASE), lambda match: '</body>'),
|
||||||
]
|
]
|
||||||
|
|
||||||
feeds = [(u'Private Eye', u'http://www.private-eye.co.uk/rss/rss.php')]
|
feeds = [(u'Private Eye', u'http://www.private-eye.co.uk/rss/rss.php')]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user