mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update The Sun
This commit is contained in:
parent
e577d39347
commit
6be236729f
@ -8,7 +8,7 @@ class AdvancedUserRecipe1325006965(BasicNewsRecipe):
|
|||||||
title = u'The Sun UK'
|
title = u'The Sun UK'
|
||||||
description = 'Articles from The Sun tabloid UK'
|
description = 'Articles from The Sun tabloid UK'
|
||||||
__author__ = 'Dave Asbury'
|
__author__ = 'Dave Asbury'
|
||||||
# last updated 6/10/12 added starsons remove article code
|
# last updated 12/10/12 added starsons remove article code
|
||||||
language = 'en_GB'
|
language = 'en_GB'
|
||||||
oldest_article = 1
|
oldest_article = 1
|
||||||
max_articles_per_feed = 15
|
max_articles_per_feed = 15
|
||||||
@ -19,6 +19,7 @@ class AdvancedUserRecipe1325006965(BasicNewsRecipe):
|
|||||||
remove_javascript = True
|
remove_javascript = True
|
||||||
no_stylesheets = True
|
no_stylesheets = True
|
||||||
|
|
||||||
|
ignore_duplicate_articles = {'title'}
|
||||||
|
|
||||||
|
|
||||||
extra_css = '''
|
extra_css = '''
|
||||||
@ -51,8 +52,10 @@ class AdvancedUserRecipe1325006965(BasicNewsRecipe):
|
|||||||
feeds = BasicNewsRecipe.parse_feeds(self)
|
feeds = BasicNewsRecipe.parse_feeds(self)
|
||||||
for feed in feeds:
|
for feed in feeds:
|
||||||
for article in feed.articles[:]:
|
for article in feed.articles[:]:
|
||||||
# print 'article.title is: ', article.title
|
print 'article.title is: ', article.title
|
||||||
if 'Web porn harms kids' in article.title.upper() or 'The-Sun-says' in article.url:
|
if 'Try out The Sun' in article.title.upper() or 'Try-out-The-Suns' in article.url:
|
||||||
|
feed.articles.remove(article)
|
||||||
|
if 'Web porn harms kids' in article.title.upper() or 'Sun-says-Web-porn' in article.url:
|
||||||
feed.articles.remove(article)
|
feed.articles.remove(article)
|
||||||
return feeds
|
return feeds
|
||||||
|
|
||||||
@ -72,7 +75,6 @@ class AdvancedUserRecipe1325006965(BasicNewsRecipe):
|
|||||||
cov2 = str(cov)
|
cov2 = str(cov)
|
||||||
cov2=cov2[27:-18]
|
cov2=cov2[27:-18]
|
||||||
#cov2 now is pic url, now go back to original function
|
#cov2 now is pic url, now go back to original function
|
||||||
# print "**** cov2 =",cov2,"****"
|
|
||||||
br = browser()
|
br = browser()
|
||||||
br.set_handle_redirect(False)
|
br.set_handle_redirect(False)
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user