Sync to trunk.

This commit is contained in:
John Schember 2013-04-04 20:09:32 -04:00
commit e586b6222d
91 changed files with 23602 additions and 16912 deletions

View File

@ -9,14 +9,14 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
__author__ = 'Dave Asbury'
cover_url = 'http://profile.ak.fbcdn.net/hprofile-ak-snc4/161987_9010212100_2035706408_n.jpg'
oldest_article = 2
max_articles_per_feed = 12
max_articles_per_feed = 20
linearize_tables = True
remove_empty_feeds = True
remove_javascript = True
no_stylesheets = True
auto_cleanup = True
language = 'en_GB'
compress_news_images = True
cover_url = 'http://profile.ak.fbcdn.net/hprofile-ak-snc4/161987_9010212100_2035706408_n.jpg'
masthead_url = 'http://www.trinitymirror.com/images/birminghampost-logo.gif'

View File

@ -7,13 +7,14 @@ class AdvancedUserRecipe1325006965(BasicNewsRecipe):
#cover_url = 'http://www.countryfile.com/sites/default/files/imagecache/160px_wide/cover/2_1.jpg'
__author__ = 'Dave Asbury'
description = 'The official website of Countryfile Magazine'
# last updated 8/12/12
# last updated 19/10/12
language = 'en_GB'
oldest_article = 30
max_articles_per_feed = 25
remove_empty_feeds = True
no_stylesheets = True
auto_cleanup = True
compress_news_images = True
ignore_duplicate_articles = {'title', 'url'}
#articles_are_obfuscated = True
#article_already_exists = False

View File

@ -13,9 +13,9 @@ class AdvancedUserRecipe1306061239(BasicNewsRecipe):
masthead_url = 'http://www.nmauk.co.uk/nma/images/daily_mirror.gif'
compress_news_images = True
oldest_article = 1
max_articles_per_feed = 1
max_articles_per_feed = 12
remove_empty_feeds = True
remove_javascript = True
no_stylesheets = True

View File

@ -8,6 +8,7 @@ import datetime
from calibre.ptempfile import PersistentTemporaryFile
from calibre import strftime
from calibre.web.feeds.news import BasicNewsRecipe
from collections import OrderedDict
class FinancialTimes(BasicNewsRecipe):
title = 'Financial Times (UK)'
@ -93,7 +94,7 @@ class FinancialTimes(BasicNewsRecipe):
try:
urlverified = self.browser.open_novisit(url).geturl() # resolve redirect.
except:
continue
continue
title = self.tag_to_string(item)
date = strftime(self.timefmt)
articles.append({
@ -105,29 +106,28 @@ class FinancialTimes(BasicNewsRecipe):
return articles
def parse_index(self):
feeds = []
feeds = OrderedDict()
soup = self.index_to_soup(self.INDEX)
dates= self.tag_to_string(soup.find('div', attrs={'class':'btm-links'}).find('div'))
self.timefmt = ' [%s]'%dates
wide = soup.find('div',attrs={'class':'wide'})
if not wide:
return feeds
allsections = wide.findAll(attrs={'class':lambda x: x and 'footwell' in x.split()})
if not allsections:
return feeds
count = 0
for item in allsections:
count = count + 1
if self.test and count > 2:
return feeds
fitem = item.h3
if not fitem:
fitem = item.h4
ftitle = self.tag_to_string(fitem)
self.report_progress(0, _('Fetching feed')+' %s...'%(ftitle))
feedarts = self.get_artlinks(item.ul)
feeds.append((ftitle,feedarts))
return feeds
#dates= self.tag_to_string(soup.find('div', attrs={'class':'btm-links'}).find('div'))
#self.timefmt = ' [%s]'%dates
for column in soup.findAll('div', attrs = {'class':'feedBoxes clearfix'}):
for section in column. findAll('div', attrs = {'class':'feedBox'}):
section_title=self.tag_to_string(section.find('h4'))
for article in section.ul.findAll('li'):
articles = []
title=self.tag_to_string(article.a)
url=article.a['href']
articles.append({'title':title, 'url':url, 'description':'', 'date':''})
if articles:
if section_title not in feeds:
feeds[section_title] = []
feeds[section_title] += articles
ans = [(key, val) for key, val in feeds.iteritems()]
return ans
def preprocess_html(self, soup):
items = ['promo-box','promo-title',
@ -174,9 +174,6 @@ class FinancialTimes(BasicNewsRecipe):
count += 1
tfile = PersistentTemporaryFile('_fa.html')
tfile.write(html)
tfile.close()
tfile.close()
self.temp_files.append(tfile)
return tfile.name
def cleanup(self):
self.browser.open('https://registration.ft.com/registration/login/logout?location=')

View File

@ -1,6 +1,4 @@
from calibre.web.feeds.news import BasicNewsRecipe
import re
from datetime import date, timedelta
class HBR(BasicNewsRecipe):
@ -11,16 +9,11 @@ class HBR(BasicNewsRecipe):
timefmt = ' [%B %Y]'
language = 'en'
no_stylesheets = True
# recipe_disabled = ('hbr.org has started requiring the use of javascript'
# ' to log into their website. This is unsupported in calibre, so'
# ' this recipe has been disabled. If you would like to see '
# ' HBR supported in calibre, contact hbr.org and ask them'
# ' to provide a javascript free login method.')
LOGIN_URL = 'https://hbr.org/login?request_url=/'
LOGOUT_URL = 'https://hbr.org/logout?request_url=/'
INDEX = 'http://hbr.org/archive-toc/BR'
INDEX = 'http://hbr.org'
keep_only_tags = [dict(name='div', id='pageContainer')]
remove_tags = [dict(id=['mastheadContainer', 'magazineHeadline',
@ -57,22 +50,6 @@ class HBR(BasicNewsRecipe):
if url.endswith('/ar/1'):
return url[:-1]+'pr'
def hbr_get_toc(self):
# return self.index_to_soup(open('/t/toc.html').read())
today = date.today()
future = today + timedelta(days=30)
past = today - timedelta(days=30)
for x in [x.strftime('%y%m') for x in (future, today, past)]:
url = self.INDEX + x
soup = self.index_to_soup(url)
if (not soup.find(text='Issue Not Found') and not soup.find(
text="We're Sorry. There was an error processing your request")
and 'Exception: java.io.FileNotFoundException' not in
unicode(soup)):
return soup
raise Exception('Could not find current issue')
def hbr_parse_toc(self, soup):
feeds = []
current_section = None
@ -105,23 +82,19 @@ class HBR(BasicNewsRecipe):
articles.append({'title':title, 'url':url, 'description':desc,
'date':''})
if current_section is not None and articles:
feeds.append((current_section, articles))
return feeds
def parse_index(self):
soup = self.hbr_get_toc()
# open('/t/hbr.html', 'wb').write(unicode(soup).encode('utf-8'))
soup0 = self.index_to_soup('http://hbr.org/magazine')
datencover = soup0.find('ul', attrs={'id':'magazineArchiveCarousel'}).findAll('li')[-1]
#find date & cover
self.cover_url=datencover.img['src']
dates=self.tag_to_string(datencover.img['alt'])
self.timefmt = u' [%s]'%dates
soup = self.index_to_soup(self.INDEX + soup0.find('div', attrs = {'class':'magazine_page'}).a['href'])
feeds = self.hbr_parse_toc(soup)
return feeds
def get_cover_url(self):
cover_url = None
index = 'http://hbr.org/current'
soup = self.index_to_soup(index)
link_item = soup.find('img', alt=re.compile("Current Issue"), src=True)
if link_item:
cover_url = 'http://hbr.org' + link_item['src']
return cover_url

View File

@ -6,10 +6,10 @@ import time
class AdvancedUserRecipe1306097511(BasicNewsRecipe):
title = u'Metro UK'
description = 'News as provided by The Metro -UK'
description = 'News from The Metro, UK'
#timefmt = ''
__author__ = 'fleclerc & Dave Asbury'
#last update 20/1/13
__author__ = 'Dave Asbury'
#last update 4/4/13
#cover_url = 'http://profile.ak.fbcdn.net/hprofile-ak-snc4/276636_117118184990145_2132092232_n.jpg'
cover_url = 'https://twimg0-a.akamaihd.net/profile_images/1638332595/METRO_LETTERS-01.jpg'
@ -22,7 +22,7 @@ class AdvancedUserRecipe1306097511(BasicNewsRecipe):
language = 'en_GB'
masthead_url = 'http://e-edition.metro.co.uk/images/metro_logo.gif'
compress_news_images = True
def parse_index(self):
articles = {}
key = None

View File

@ -12,6 +12,7 @@ class AdvancedUserRecipe1306061239(BasicNewsRecipe):
max_articles_per_feed = 20
#auto_cleanup = True
language = 'en_GB'
compress_news_images = True
def get_cover_url(self):
soup = self.index_to_soup('http://www.nme.com/component/subscribe')
@ -27,7 +28,7 @@ class AdvancedUserRecipe1306061239(BasicNewsRecipe):
br.open_novisit(cov2)
cover_url = str(cov2)
except:
cover_url = 'http://tawanda3000.files.wordpress.com/2011/02/nme-logo.jpg'
cover_url = 'http://tawanda3000.files.wordpress.com/2011/02/nme-logo.jpg'
return cover_url
masthead_url = 'http://tawanda3000.files.wordpress.com/2011/02/nme-logo.jpg'

View File

@ -20,7 +20,7 @@ class AdvancedUserRecipe1325006965(BasicNewsRecipe):
no_stylesheets = True
ignore_duplicate_articles = {'title','url'}
compress_news_images = True
extra_css = '''
body{ text-align: justify; font-family:Arial,Helvetica,sans-serif; font-size:11px; font-size-adjust:none; font-stretch:normal; font-style:normal; font-variant:normal; font-weight:normal;}

View File

@ -12,13 +12,13 @@ msgstr ""
"Report-Msgid-Bugs-To: Debian iso-codes team <pkg-isocodes-"
"devel@lists.alioth.debian.org>\n"
"POT-Creation-Date: 2011-11-25 14:01+0000\n"
"PO-Revision-Date: 2013-03-27 13:07+0000\n"
"PO-Revision-Date: 2013-03-28 13:01+0000\n"
"Last-Translator: Ferran Rius <frius64@hotmail.com>\n"
"Language-Team: Catalan <linux@softcatala.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2013-03-28 04:41+0000\n"
"X-Launchpad-Export-Date: 2013-03-29 04:36+0000\n"
"X-Generator: Launchpad (build 16546)\n"
"Language: ca\n"
@ -1884,7 +1884,7 @@ msgstr "Awera"
#. name for aws
msgid "Awyu; South"
msgstr "Awyu meridional"
msgstr "Awyu; meridional"
#. name for awt
msgid "Araweté"
@ -1892,7 +1892,7 @@ msgstr "Araweté"
#. name for awu
msgid "Awyu; Central"
msgstr "Awyu central"
msgstr "Awyu; Central"
#. name for awv
msgid "Awyu; Jair"
@ -4052,7 +4052,7 @@ msgstr "Buginès"
#. name for buh
msgid "Bunu; Younuo"
msgstr "Bunu; Younuo"
msgstr "Bunu; Younou"
#. name for bui
msgid "Bongili"
@ -4308,7 +4308,7 @@ msgstr "Bwa"
#. name for bwx
msgid "Bunu; Bu-Nao"
msgstr "Bunu; Bu-Nao"
msgstr "Bunu; Bu Nao"
#. name for bwy
msgid "Bwamu; Cwi"
@ -19804,7 +19804,7 @@ msgstr "Minoà"
#. name for omo
msgid "Utarmbung"
msgstr ""
msgstr "Utarmbung"
#. name for omp
msgid "Manipuri; Old"
@ -20344,7 +20344,7 @@ msgstr "Pear"
#. name for pcc
msgid "Bouyei"
msgstr ""
msgstr "Buyí"
#. name for pcd
msgid "Picard"
@ -20456,11 +20456,11 @@ msgstr "Pengo"
#. name for peh
msgid "Bonan"
msgstr ""
msgstr "Bonan"
#. name for pei
msgid "Chichimeca-Jonaz"
msgstr ""
msgstr "Chichimec"
#. name for pej
msgid "Pomo; Northern"
@ -20484,7 +20484,7 @@ msgstr "Persa Antic"
#. name for pep
msgid "Kunja"
msgstr ""
msgstr "Kunja"
#. name for peq
msgid "Pomo; Southern"
@ -20536,7 +20536,7 @@ msgstr "Pagi"
#. name for pgk
msgid "Rerep"
msgstr ""
msgstr "Rerep"
#. name for pgl
msgid "Irish; Primitive"
@ -20624,7 +20624,7 @@ msgstr "Pima Baix"
#. name for pib
msgid "Yine"
msgstr ""
msgstr "Yine"
#. name for pic
msgid "Pinji"
@ -20660,7 +20660,7 @@ msgstr "Pijao"
#. name for pil
msgid "Yom"
msgstr ""
msgstr "Yom"
#. name for pim
msgid "Powhatan"
@ -20760,7 +20760,7 @@ msgstr "Llenguatge de signes pakistaní"
#. name for pkt
msgid "Maleng"
msgstr ""
msgstr "Maleng"
#. name for pku
msgid "Paku"
@ -20768,7 +20768,7 @@ msgstr "Paku"
#. name for pla
msgid "Miani"
msgstr ""
msgstr "Miani"
#. name for plb
msgid "Polonombauk"
@ -20804,7 +20804,7 @@ msgstr "Polci"
#. name for plk
msgid "Shina; Kohistani"
msgstr ""
msgstr "Shina; Kohistani"
#. name for pll
msgid "Palaung; Shwe"
@ -20852,7 +20852,7 @@ msgstr "Palawà; Brooke"
#. name for ply
msgid "Bolyu"
msgstr ""
msgstr "Bolyu"
#. name for plz
msgid "Paluan"
@ -20896,7 +20896,7 @@ msgstr "Algonquí Carolina"
#. name for pml
msgid "Lingua Franca"
msgstr ""
msgstr "Aljamia"
#. name for pmm
msgid "Pomo"
@ -20924,7 +20924,7 @@ msgstr "Piemontès"
#. name for pmt
msgid "Tuamotuan"
msgstr ""
msgstr "Tuamotu"
#. name for pmu
msgid "Panjabi; Mirpur"
@ -20972,7 +20972,7 @@ msgstr "Penrhyn"
#. name for pni
msgid "Aoheng"
msgstr ""
msgstr "Aoheng"
#. name for pnm
msgid "Punan Batu 1"
@ -21008,7 +21008,7 @@ msgstr "Pontic"
#. name for pnu
msgid "Bunu; Jiongnai"
msgstr ""
msgstr "Bunu; Jiongnai"
#. name for pnv
msgid "Pinigura"
@ -21100,7 +21100,7 @@ msgstr "Potavatomi"
#. name for pov
msgid "Crioulo; Upper Guinea"
msgstr ""
msgstr "Crioll guineà"
#. name for pow
msgid "Popoloca; San Felipe Otlaltepec"
@ -21128,7 +21128,7 @@ msgstr "Paipai"
#. name for ppk
msgid "Uma"
msgstr ""
msgstr "Uma"
#. name for ppl
msgid "Pipil"
@ -21144,7 +21144,7 @@ msgstr "Papapana"
#. name for ppo
msgid "Folopa"
msgstr ""
msgstr "Folopa"
#. name for ppp
msgid "Pelende"
@ -21180,7 +21180,7 @@ msgstr "Malecite-Passamaquoddy"
#. name for prb
msgid "Lua'"
msgstr ""
msgstr "Lua"
#. name for prc
msgid "Parachi"
@ -21220,7 +21220,7 @@ msgstr "Llenguatge de signes peruà"
#. name for prm
msgid "Kibiri"
msgstr ""
msgstr "Kibiri"
#. name for prn
msgid "Prasuni"
@ -21272,7 +21272,7 @@ msgstr "Llenguatge de signes de Providencia"
#. name for psa
msgid "Awyu; Asue"
msgstr ""
msgstr "Awyu; Asue"
#. name for psc
msgid "Persian Sign Language"
@ -21328,7 +21328,7 @@ msgstr "Llenguatge de signes portuguès"
#. name for pss
msgid "Kaulong"
msgstr ""
msgstr "Kaulong"
#. name for pst
msgid "Pashto; Central"
@ -21376,11 +21376,11 @@ msgstr "Pìamatsina"
#. name for ptt
msgid "Enrekang"
msgstr ""
msgstr "Enrekang"
#. name for ptu
msgid "Bambam"
msgstr ""
msgstr "Bambam"
#. name for ptv
msgid "Port Vato"
@ -29584,7 +29584,7 @@ msgstr ""
#. name for yir
msgid "Awyu; North"
msgstr ""
msgstr "Awyu; Septentrional"
#. name for yis
msgid "Yis"

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff