Manual de usuario de calibre, Publicación 2.73.0
mvtb_reg_exp, re.IGNORECASE)}),
dict(name='div', attrs={'class': re.compile(
blq_toplink_reg_exp, re.IGNORECASE)}),
dict(name='div', attrs={'class': re.compile(
prods_services_01_reg_exp, re.IGNORECASE)}),
dict(name='div', attrs={'class': re.compile(
prods_services_02_reg_exp, re.IGNORECASE)}),
dict(name='div', attrs={'class': re.compile(
blq_misc_01_reg_exp, re.IGNORECASE)}),
dict(name='div', attrs={'class': re.compile(
blq_misc_02_reg_exp, re.IGNORECASE)}),
dict(name='div', attrs={'class': re.compile(
puffbox_reg_exp, re.IGNORECASE)}),
dict(attrs={'class': re.compile(
sibtbg_reg_exp, re.IGNORECASE)}),
dict(attrs={'class': re.compile(
storyextra_reg_exp, re.IGNORECASE)})
]
# Uses url to create and return the 'printer friendly' version of the url.
# In other words the 'print this page' address of the page.
#
# There are 3 types of urls used in the BBC site's rss feeds. There is just
# 1 type for the standard news while there are 2 used for sports feed urls.
# Note: Sports urls are linked from regular news feeds (Eg. 'News Home') when
# there is a major story of interest to 'everyone'. So even if no BBC sports
# feeds are added to 'feeds' the logic of this method is still needed to avoid
# blank / missing / empty articles which have an index title and then no
# body.
def print_version(self, url):
# Handle sports page urls type 01:
if (url.find("go/rss/-/sport1/") != -1):
temp_url = url.replace("go/rss/-/", "")
# Handle sports page urls type 02:
elif (url.find("go/rss/int/news/-/sport1/") != -1):
temp_url = url.replace("go/rss/int/news/-/", "")
# Handle regular news page urls:
else:
temp_url = url.replace("go/rss/int/news/-/", "")
# Always add "?print=true" to the end of the url.
print_url = temp_url + "?print=true"
return print_url
# Remove articles in feeds based on a string in the article title or url.
#
# Code logic written by: Starson17 - posted in: "Recipes - Re-usable code"
# thread, in post with title: "Remove articles from feed", see url:
# http://www.mobileread.com/forums/showpost.php?p=1165462&postcount=6
# Many thanks and all credit to Starson17.
#
# Starson17's code has obviously been altered to suite my requirements.
def parse_feeds(self):
1.2. AƱadir su sitio de noticias favorito
41