mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #3972 (The Irish Times feeds have changed)
This commit is contained in:
parent
2f43bc64ea
commit
569dbeb2b9
@ -6,10 +6,7 @@ __docformat__ = 'restructuredtext en'
|
||||
'''
|
||||
www.guardian.co.uk
|
||||
'''
|
||||
import string
|
||||
import re
|
||||
from calibre import strftime
|
||||
from calibre.ebooks.BeautifulSoup import BeautifulSoup, Tag
|
||||
from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class Guardian(BasicNewsRecipe):
|
||||
|
@ -1,5 +1,5 @@
|
||||
__license__ = 'GPL v3'
|
||||
__copyright__ = '2008, Derry FitzGerald. 2009 Modified by Ray Kinsella'
|
||||
__copyright__ = "2008, Derry FitzGerald. 2009 Modified by Ray Kinsella and David O'Callaghan"
|
||||
'''
|
||||
irishtimes.com
|
||||
'''
|
||||
@ -9,13 +9,16 @@ from calibre.web.feeds.news import BasicNewsRecipe
|
||||
|
||||
class IrishTimes(BasicNewsRecipe):
|
||||
title = u'The Irish Times'
|
||||
__author__ = 'Derry FitzGerald and Ray Kinsella'
|
||||
__author__ = "Derry FitzGerald, Ray Kinsella and David O'Callaghan"
|
||||
language = 'en'
|
||||
timefmt = ' (%A, %B %e, %Y)'
|
||||
|
||||
|
||||
oldest_article = 3
|
||||
no_stylesheets = True
|
||||
simultaneous_downloads= 1
|
||||
|
||||
r = re.compile('.*(?P<url>http:\/\/www.irishtimes.com\/.*\.html).*')
|
||||
r = re.compile('.*(?P<url>http:\/\/(www.irishtimes.com)|(rss.feedsportal.com\/c)\/.*\.html?).*')
|
||||
remove_tags = [dict(name='div', attrs={'class':'footer'})]
|
||||
extra_css = '.headline {font-size: x-large;} \n .fact { padding-top: 10pt }'
|
||||
|
||||
@ -32,9 +35,11 @@ class IrishTimes(BasicNewsRecipe):
|
||||
|
||||
|
||||
def print_version(self, url):
|
||||
return url.replace('.html', '_pf.html')
|
||||
if url.count('rss.feedsportal.com'):
|
||||
u = url.replace('0Bhtml/story01.htm','_pf0Bhtml/story01.htm')
|
||||
else:
|
||||
u = url.replace('.html','_pf.html')
|
||||
return u
|
||||
|
||||
def get_article_url(self, article):
|
||||
m = self.r.match(article.get('description', None))
|
||||
print m.group('url')
|
||||
return m.group('url')
|
||||
return article.link
|
||||
|
Loading…
x
Reference in New Issue
Block a user