mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
New recipe for The Glasgow Herald by mccande
This commit is contained in:
parent
4cf815d792
commit
b92651ec37
@ -28,7 +28,7 @@ recipe_modules = ['recipe_' + r for r in (
|
||||
'la_tercera', 'el_mercurio_chile', 'la_cuarta', 'lanacion_chile', 'la_segunda',
|
||||
'jb_online', 'estadao', 'o_globo', 'vijesti', 'elmundo', 'the_oz',
|
||||
'honoluluadvertiser', 'starbulletin', 'exiled', 'indy_star', 'dna',
|
||||
'pobjeda', 'chicago_breaking_news',
|
||||
'pobjeda', 'chicago_breaking_news', 'glasgow_herald',
|
||||
)]
|
||||
|
||||
import re, imp, inspect, time, os
|
||||
|
34
src/calibre/web/feeds/recipes/recipe_glasgow_herald.py
Normal file
34
src/calibre/web/feeds/recipes/recipe_glasgow_herald.py
Normal file
@ -0,0 +1,34 @@
|
||||
import re
|
||||
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class GlasgowHerald(BasicNewsRecipe):
|
||||
title = u'Glasgow Herald'
|
||||
oldest_article = 1
|
||||
max_articles_per_feed = 100
|
||||
no_stylesheets = True
|
||||
language = _('English')
|
||||
__author__ = 'McCande'
|
||||
|
||||
preprocess_regexps = [ (re.compile(i[0], re.IGNORECASE | re.DOTALL), i[1]) for i in
|
||||
[
|
||||
(r'<center><h3>', lambda match : '<h3>'),
|
||||
(r'Click here to comment on this story...', lambda match : ''),
|
||||
(r'<h3>Related links</h3>.*?</head>', lambda match : '</head>'),
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
|
||||
|
||||
feeds = [
|
||||
(u'News', u'http://www.theherald.co.uk/news/news/rss.xml'),
|
||||
(u'Politics', u'http://www.theherald.co.uk/politics/news/rss.xml'),
|
||||
(u'Features', u'http://www.theherald.co.uk/features/features/rss.xml'),
|
||||
(u'Business', u'http://www.theherald.co.uk/business/news/rss.xml')]
|
||||
|
||||
def print_version(self, url):
|
||||
(beginning,end)=url.split(".var.")
|
||||
num=end[0:7]
|
||||
main="http://www.theherald.co.uk/misc/print.php?artid="+num
|
||||
return main
|
Loading…
x
Reference in New Issue
Block a user