mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-31 14:33:54 -04:00
New recipe for The Philadelphia Inquirer by RadikalDissent
This commit is contained in:
parent
ea1f813ea9
commit
b759adcee6
@ -57,7 +57,7 @@ recipe_modules = ['recipe_' + r for r in (
|
||||
'monitor', 'republika', 'beta', 'beta_en', 'glasjavnosti',
|
||||
'esquire', 'livemint', 'thedgesingapore', 'darknet', 'rga',
|
||||
'intelligencer', 'theoldfoodie', 'hln_be', 'honvedelem',
|
||||
'the_new_republic',
|
||||
'the_new_republic', 'philly',
|
||||
)]
|
||||
|
||||
|
||||
|
56
src/calibre/web/feeds/recipes/recipe_philly.py
Normal file
56
src/calibre/web/feeds/recipes/recipe_philly.py
Normal file
@ -0,0 +1,56 @@
|
||||
#!/usr/bin/env python
|
||||
__license__ = 'GPL v3'
|
||||
'''
|
||||
philly.com/inquirer/
|
||||
'''
|
||||
import re
|
||||
from calibre.web.feeds.recipes import BasicNewsRecipe
|
||||
|
||||
class Philly(BasicNewsRecipe):
|
||||
|
||||
title = 'Philadelphia Inquirer'
|
||||
__author__ = 'RadikalDissent'
|
||||
language = 'en'
|
||||
description = 'Daily news from the Philadelphia Inquirer'
|
||||
no_stylesheets = True
|
||||
use_embedded_content = False
|
||||
oldest_article = 1
|
||||
max_articles_per_feed = 25
|
||||
extra_css = '''
|
||||
.byline {font-size: small; color: grey; font-style:italic; }
|
||||
.lastline {font-size: small; color: grey; font-style:italic;}
|
||||
.contact {font-size: small; color: grey;}
|
||||
.contact p {font-size: small; color: grey;}
|
||||
'''
|
||||
preprocess_regexps = [(re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
|
||||
[
|
||||
(r'<body.*<h1>', lambda match: '<body><h1>'),
|
||||
(r'<font size="2" face="Arial">', lambda match: '<div class="contact"><font class="contact">'),
|
||||
(r'<font face="Arial" size="2">', lambda match: '<div class="contact"><font class="contact">')
|
||||
]
|
||||
]
|
||||
keep_only_tags = [
|
||||
dict(name='h1'),
|
||||
dict(name='p', attrs={'class':['byline','lastline']}),
|
||||
dict(name='div', attrs={'class':'body-content'}),
|
||||
]
|
||||
|
||||
remove_tags = [
|
||||
dict(name='hr'),
|
||||
dict(name='p', attrs={'class':'buzzBadge'}),
|
||||
]
|
||||
def print_version(self, url):
|
||||
return url + '?viewAll=y'
|
||||
|
||||
|
||||
feeds = [
|
||||
('Front Page', 'http://www.philly.com/inquirer_front_page.rss'),
|
||||
('Business', 'http://www.philly.com/inq_business.rss'),
|
||||
('News', 'http://www.philly.com/inquirer/news/index.rss'),
|
||||
('Nation', 'http://www.philly.com/inq_news_world_us.rss'),
|
||||
('Local', 'http://www.philly.com/inquirer_local.rss'),
|
||||
('Health', 'http://www.philly.com/inquirer_health_science.rss'),
|
||||
('Education', 'http://www.philly.com/inquirer_education.rss'),
|
||||
('Editorial and opinion', 'http://www.philly.com/inq_news_editorial.rss'),
|
||||
('Sports', 'http://www.philly.com/inquirer_sports.rss')
|
||||
]
|
Loading…
x
Reference in New Issue
Block a user