diff --git a/recipes/ancient_egypt.recipe b/recipes/ancient_egypt.recipe index c2116a00a4..c40b0aa3cc 100644 --- a/recipes/ancient_egypt.recipe +++ b/recipes/ancient_egypt.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' https://ancientegyptmagazine.com ''' diff --git a/recipes/bbc.recipe b/recipes/bbc.recipe index 93b5eddccf..7302d02d3f 100644 --- a/recipes/bbc.recipe +++ b/recipes/bbc.recipe @@ -234,6 +234,20 @@ class BBCNews(BasicNewsRecipe): # oldest_article = 1.5 + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + # Number of simultaneous downloads. 20 is consistently working fine on the # BBC News feeds with no problems. Speeds things up from the default of 5. # If you have a lot of feeds and/or have increased oldest_article above 2 diff --git a/recipes/bloomberg-business-week.recipe b/recipes/bloomberg-business-week.recipe index d6bfa7f12d..d43bc0cd86 100644 --- a/recipes/bloomberg-business-week.recipe +++ b/recipes/bloomberg-business-week.recipe @@ -1,3 +1,6 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 + import json import time from datetime import datetime @@ -58,7 +61,7 @@ class Bloomberg(BasicNewsRecipe): remove_empty_feeds = True recipe_specific_options = { - 'date': { + 'issue': { 'short': 'The ID of the edition to download (YY_XX format)', 'long': 'For example, 24_17\nHint: Edition ID can be found at the end of its URL' } @@ -86,7 +89,7 @@ class Bloomberg(BasicNewsRecipe): inx = 'https://cdn-mobapi.bloomberg.com' sec = self.index_to_soup(inx + '/wssmobile/v1/bw/news/list?limit=1', raw=True) id = json.loads(sec)['magazines'][0]['id'] - past_edition = self.recipe_specific_options.get('date') + past_edition = self.recipe_specific_options.get('issue') if past_edition and isinstance(past_edition, str): id = past_edition edit = self.index_to_soup(inx + '/wssmobile/v1/bw/news/week/' + id, raw=True) diff --git a/recipes/business_standard_print.recipe b/recipes/business_standard_print.recipe index ff7d63ff98..a5b2187fac 100644 --- a/recipes/business_standard_print.recipe +++ b/recipes/business_standard_print.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json from datetime import datetime diff --git a/recipes/eenadu.recipe b/recipes/eenadu.recipe index ed2e254e19..5072bb3866 100644 --- a/recipes/eenadu.recipe +++ b/recipes/eenadu.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import re from datetime import date, datetime, timedelta diff --git a/recipes/eenadu_ap.recipe b/recipes/eenadu_ap.recipe index 6cbbb4395e..1a36c5bbef 100644 --- a/recipes/eenadu_ap.recipe +++ b/recipes/eenadu_ap.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import re from datetime import datetime, timedelta from urllib.parse import quote diff --git a/recipes/el_correo.recipe b/recipes/el_correo.recipe index f83ee410df..a803a0ce67 100644 --- a/recipes/el_correo.recipe +++ b/recipes/el_correo.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' http://www.elcorreo.com/ ''' @@ -22,6 +24,20 @@ class elcorreo(BasicNewsRecipe): max_articles_per_feed = 25 # articles compress_news_images = True + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + extra_css = ''' .v-mdl-ath__inf, .v-mdl-ath__p--2, .v-mdl-ath__p {font-size:small; color:#404040;} .v-fc, .v-a-fig { text-align:center; font-size:small; } diff --git a/recipes/el_pais.recipe b/recipes/el_pais.recipe index 0bf6fb5ce3..ffe83b57dc 100644 --- a/recipes/el_pais.recipe +++ b/recipes/el_pais.recipe @@ -27,6 +27,20 @@ class ElPais(BasicNewsRecipe): oldest_article = 2.1 max_articles_per_feed = 25 + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + use_embedded_content = False recursion = 5 diff --git a/recipes/epoch_times.recipe b/recipes/epoch_times.recipe index cf2c0cc8b8..d0da409b37 100644 --- a/recipes/epoch_times.recipe +++ b/recipes/epoch_times.recipe @@ -19,6 +19,20 @@ class EpochTimes(BasicNewsRecipe): masthead_url = 'https://epochtimes-ny.newsmemory.com/eeLayout/epochtimes/1.0.a/images/webapp/banner.png' extra_css = '.post_caption, .text-sm, .uppercase {font-size:small;}' + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + keep_only_tags = [ dict(name='article') ] diff --git a/recipes/financial_times.recipe b/recipes/financial_times.recipe index 62384d6aed..581ca3ab79 100644 --- a/recipes/financial_times.recipe +++ b/recipes/financial_times.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import re from urllib.parse import quote @@ -31,6 +33,20 @@ class ft(BasicNewsRecipe): .o-topper__topic { font-size:small; color:#5c5c5c; } ''' + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + keep_only_tags = [ classes( 'body_json o-topper__topic o-topper__headline o-topper__standfirst o-topper__visual article-info__time-byline main-image' diff --git a/recipes/foreign_policy.recipe b/recipes/foreign_policy.recipe index a702fa81e0..89d8fc5b2d 100644 --- a/recipes/foreign_policy.recipe +++ b/recipes/foreign_policy.recipe @@ -47,8 +47,20 @@ class ForeignPolicy(BasicNewsRecipe): ] remove_tags_after = [classes('post-content-main')] + recipe_specific_options = { + 'issue': { + 'short': 'Enter the Issue ID you want to download ', + 'long': 'For example, 411131563' + } + } + def parse_index(self): - soup = self.index_to_soup('https://foreignpolicy.com/the-magazine') + issue_url = 'https://foreignpolicy.com/the-magazine' + d = self.recipe_specific_options.get('issue') + if d and isinstance(d, str): + issue_url = issue_url + '/?issue_id=' + d + + soup = self.index_to_soup(issue_url) img = soup.find('img', attrs={'src': lambda x: x and '-cover' in x}) if img: self.cover_url = img['src'].split('?')[0] + '?w=800?quality=90' diff --git a/recipes/globaltimes.recipe b/recipes/globaltimes.recipe index e40bab6b40..e7d808c1ad 100644 --- a/recipes/globaltimes.recipe +++ b/recipes/globaltimes.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from datetime import datetime, timedelta, timezone from calibre.utils.date import parse_date @@ -29,6 +31,20 @@ class GlobalTimes(BasicNewsRecipe): blockquote, em {color:#202020;} ''' + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + keep_only_tags = [ classes( 'article_column article_title author_share_left article_content' diff --git a/recipes/harpers.recipe b/recipes/harpers.recipe index be5a87086e..5a502af504 100644 --- a/recipes/harpers.recipe +++ b/recipes/harpers.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' harpers.org ''' diff --git a/recipes/himal_southasian.recipe b/recipes/himal_southasian.recipe index 5025806326..85188e0af9 100644 --- a/recipes/himal_southasian.recipe +++ b/recipes/himal_southasian.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json from calibre.web.feeds.news import BasicNewsRecipe @@ -37,6 +39,20 @@ class himal(BasicNewsRecipe): resolve_internal_links = True oldest_article = 30 # days + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + extra_css = ''' .cap, .auth {font-size:small;} em, blockquote {color:#404040;} diff --git a/recipes/hindu.recipe b/recipes/hindu.recipe index 8b81d0b405..b9379bdb68 100644 --- a/recipes/hindu.recipe +++ b/recipes/hindu.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import re from collections import defaultdict @@ -32,7 +34,7 @@ class TheHindu(BasicNewsRecipe): recipe_specific_options = { 'location': { 'short': 'The name of the local edition', - 'long': 'If The Hindu is available in your local town/city,\nset this to your location, for example, hyderabad', + 'long': 'If The Hindu is available in your local town/city,\nset this to your location, for example, hyderabad\nAvailable Editions: bengaluru, chennai, coimbatore, delhi, erode, hyderabad, international, kochi, kolkata,\nkozhikode, madurai, mangalore, mumbai, thiruvananthapuram, tiruchirapalli, vijayawada, visakhapatnam', 'default': 'international' }, 'date': { diff --git a/recipes/hindufeeds.recipe b/recipes/hindufeeds.recipe index 113ac6350f..94b00acc88 100644 --- a/recipes/hindufeeds.recipe +++ b/recipes/hindufeeds.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from datetime import date from calibre.web.feeds.news import BasicNewsRecipe, classes @@ -24,6 +26,20 @@ class TheHindufeeds(BasicNewsRecipe): .italic {font-style:italic; color:#202020;} ''' + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + ignore_duplicate_articles = {'url'} keep_only_tags = [ diff --git a/recipes/hindustan_times_print.recipe b/recipes/hindustan_times_print.recipe index a8eee1e21a..94bf2db993 100644 --- a/recipes/hindustan_times_print.recipe +++ b/recipes/hindustan_times_print.recipe @@ -1,20 +1,11 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json from collections import defaultdict from datetime import date from calibre.web.feeds.news import BasicNewsRecipe -# figure out your local_edition from the fetch news log of this recipe -local_edition = 'Delhi' - -today = date.today().strftime('%d/%m/%Y') - -# for older edition, change today -# today = '22/12/2023' - -day, month, year = (int(x) for x in today.split('/')) -dt = date(year, month, day) -today = today.replace('/', '%2F') index = 'https://epaper.hindustantimes.com' @@ -23,28 +14,49 @@ class ht(BasicNewsRecipe): language = 'en_IN' __author__ = 'unkn0wn' masthead_url = 'https://www.htmedia.in/wp-content/uploads/2020/08/HT-dot-com-logo-product.png' - timefmt = ' [' + dt.strftime('%b %d, %Y') + ']' description = 'Articles from the Hindustan Times epaper, digital edition' encoding = 'utf-8' delay = 1 ignore_duplicate_articles = {'title'} - def __init__(self, *args, **kwargs): - BasicNewsRecipe.__init__(self, *args, **kwargs) - if self.output_profile.short_name.startswith('kindle'): - self.title = 'HT Print Edition ' + dt.strftime('%b %d, %Y') - extra_css = ''' .cap { text-align:center; font-size:small; } img { display:block; margin:0 auto; } ''' - def parse_index(self): + recipe_specific_options = { + 'location': { + 'short': 'The name of the local edition', + 'long': 'If The Hindustan Times is available in your local town/city,\nset this to your location, for example, Delhi\nAvailable Editions: Delhi, Mumbai, Chandigarh, Lucknow, Patna, Bengaluru, Pune, Gurgaon, Ludhiana, Rajasthan, Amritsar,\nEast UP, Haryana, Jammu, Navi Mumbai, Noida, Punjab, Ranchi, Thane, Uttarakhand, West UP', + 'default': 'Delhi' + }, + 'date': { + 'short': 'The date of the edition to download (DD/MM/YYYY format)', + 'long': 'For example, 22/12/2023' + } + } + def parse_index(self): self.log( '\n***\nif this recipe fails, report it on: ' 'https://www.mobileread.com/forums/forumdisplay.php?f=228\n***\n' ) + local_edition = 'Delhi' + d = self.recipe_specific_options.get('location') + if d and isinstance(d, str): + local_edition = d + + today = date.today().strftime('%d/%m/%Y') + + p = self.recipe_specific_options.get('date') + if p and isinstance(p, str): + today = p + + self.timefmt = ' [%s]' % today + + day, month, year = (int(x) for x in today.split('/')) + dt = date(year, month, day) + today = today.replace('/', '%2F') get_edition = index + '/Home/GetEditionSupplementHierarchy?EditionDate=' + today edi_data = json.loads(self.index_to_soup(get_edition, raw=True)) @@ -56,7 +68,7 @@ class ht(BasicNewsRecipe): if edi['EditionName'] == local_edition: edi_name = edi['EditionName'] edi_id = str(edi['EditionId']) - self.log('Downloading', edi_name, 'Edition') + self.log('Downloading', edi_name, 'Edition', self.timefmt) url = index + '/Home/GetAllpages?editionid=' + edi_id + '&editiondate=' + today main_data = json.loads(self.index_to_soup(url, raw=True)) diff --git a/recipes/india_today.recipe b/recipes/india_today.recipe index f89fb47d14..c8e648e93b 100644 --- a/recipes/india_today.recipe +++ b/recipes/india_today.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from calibre.ebooks.BeautifulSoup import Tag from calibre.web.feeds.news import BasicNewsRecipe diff --git a/recipes/le_monde.recipe b/recipes/le_monde.recipe index f16c39c6ac..f815b1cc38 100644 --- a/recipes/le_monde.recipe +++ b/recipes/le_monde.recipe @@ -36,6 +36,20 @@ class LeMonde(BasicNewsRecipe): 'publisher': publisher } + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + masthead_url = 'http://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Le_monde_logo.svg/800px-Le_monde_logo.svg.png' feeds = [ diff --git a/recipes/le_monde_diplomatique_fr.recipe b/recipes/le_monde_diplomatique_fr.recipe index ec14aeaf1d..556af30b61 100644 --- a/recipes/le_monde_diplomatique_fr.recipe +++ b/recipes/le_monde_diplomatique_fr.recipe @@ -1,3 +1,4 @@ +#!/usr/bin/env python # vim:fileencoding=utf-8 from __future__ import unicode_literals @@ -33,6 +34,20 @@ class LeMondeDiplomatiqueSiteWeb(BasicNewsRecipe): timefmt = ' [%d %b %Y]' no_stylesheets = True + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + feeds = [(u'Blogs', u'http://blog.mondediplo.net/spip.php?page=backend'), (u'Archives', u'http://www.monde-diplomatique.fr/rss/')] diff --git a/recipes/lex_fridman_podcast.recipe b/recipes/lex_fridman_podcast.recipe index 5fc387f036..8dfb25a5c2 100644 --- a/recipes/lex_fridman_podcast.recipe +++ b/recipes/lex_fridman_podcast.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from calibre.web.feeds.news import BasicNewsRecipe diff --git a/recipes/liberation.recipe b/recipes/liberation.recipe index a2c85284f3..a8d072ad7a 100644 --- a/recipes/liberation.recipe +++ b/recipes/liberation.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' liberation.fr ''' diff --git a/recipes/livemint.recipe b/recipes/livemint.recipe index 3ea015d557..eba947ede0 100644 --- a/recipes/livemint.recipe +++ b/recipes/livemint.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import re from datetime import date @@ -35,10 +37,6 @@ class LiveMint(BasicNewsRecipe): d = self.recipe_specific_options.get('days') if d and isinstance(d, str): self.oldest_article = float(d) - if self.output_profile.short_name.startswith('kindle'): - self.title = 'Mint | ' + date.today().strftime('%b %d, %Y') - if is_saturday: - self.title = 'Mint Lounge | ' + date.today().strftime('%b %d, %Y') def get_cover_url(self): today = date.today().strftime('%d/%m/%Y') @@ -51,7 +49,7 @@ class LiveMint(BasicNewsRecipe): return cov['HighResolution'] if is_saturday: - + self.title = 'Mint Lounge' masthead_url = 'https://lifestyle.livemint.com/mintlounge/static-images/lounge-logo.svg' oldest_article = 6.5 # days diff --git a/recipes/military_history.recipe b/recipes/military_history.recipe index 09d330a09b..9d04d65146 100644 --- a/recipes/military_history.recipe +++ b/recipes/military_history.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' https://www.military-history.org/ ''' diff --git a/recipes/minerva_magazine.recipe b/recipes/minerva_magazine.recipe index 203d9b3520..57037bd662 100644 --- a/recipes/minerva_magazine.recipe +++ b/recipes/minerva_magazine.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' https://minervamagazine.com/ ''' diff --git a/recipes/outlook_india.recipe b/recipes/outlook_india.recipe index 6c6558c1c4..b91b6ce4e8 100644 --- a/recipes/outlook_india.recipe +++ b/recipes/outlook_india.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from calibre.web.feeds.news import BasicNewsRecipe, classes diff --git a/recipes/poliitico_eu.recipe b/recipes/poliitico_eu.recipe index a5b602173e..44f4e9f484 100644 --- a/recipes/poliitico_eu.recipe +++ b/recipes/poliitico_eu.recipe @@ -27,6 +27,20 @@ class Politico(BasicNewsRecipe): encoding = 'UTF-8' language = 'en' + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + remove_empty_feeds = True ignore_duplicate_articles = ['url'] diff --git a/recipes/reuters.recipe b/recipes/reuters.recipe index e22b1a61f4..7fdbbbb997 100644 --- a/recipes/reuters.recipe +++ b/recipes/reuters.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import time from datetime import datetime, timedelta diff --git a/recipes/rtnews.recipe b/recipes/rtnews.recipe index a76411a8fc..b4e99da434 100644 --- a/recipes/rtnews.recipe +++ b/recipes/rtnews.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' rt.com ''' diff --git a/recipes/spectator_magazine.recipe b/recipes/spectator_magazine.recipe index fd3f9febee..c9bc29c652 100644 --- a/recipes/spectator_magazine.recipe +++ b/recipes/spectator_magazine.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from calibre.web.feeds.news import BasicNewsRecipe, classes diff --git a/recipes/the_week.recipe b/recipes/the_week.recipe index a3d0110ebc..0e898bd3a0 100644 --- a/recipes/the_week.recipe +++ b/recipes/the_week.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 from datetime import datetime from calibre.web.feeds.news import BasicNewsRecipe, classes diff --git a/recipes/tls_mag.recipe b/recipes/tls_mag.recipe index c8f8b239b6..9cd10dcf51 100644 --- a/recipes/tls_mag.recipe +++ b/recipes/tls_mag.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import re diff --git a/recipes/wash_post.recipe b/recipes/wash_post.recipe index 6460104be8..73d869a905 100644 --- a/recipes/wash_post.recipe +++ b/recipes/wash_post.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 __license__ = 'GPL v3' __copyright__ = '2011, Darko Miletic ' ''' @@ -28,6 +30,20 @@ class TheWashingtonPost(BasicNewsRecipe): publication_type = 'newspaper' remove_attributes = ['style', 'width', 'height'] + recipe_specific_options = { + 'days': { + 'short': 'Oldest article to download from this news source. In days ', + 'long': 'For example, 0.5, gives you articles from the past 12 hours', + 'default': str(oldest_article) + } + } + + def __init__(self, *args, **kwargs): + BasicNewsRecipe.__init__(self, *args, **kwargs) + d = self.recipe_specific_options.get('days') + if d and isinstance(d, str): + self.oldest_article = float(d) + extra_css = ''' .img { text-align:center; font-size:small; } .auth { font-weight:bold; font-size:small; } diff --git a/recipes/world_archeology.recipe b/recipes/world_archeology.recipe index 31d467a3fd..008f2ff1bf 100644 --- a/recipes/world_archeology.recipe +++ b/recipes/world_archeology.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 ''' https://www.world-archaeology.com ''' diff --git a/recipes/wsj.recipe b/recipes/wsj.recipe index 35587f971d..4cad8727f9 100644 --- a/recipes/wsj.recipe +++ b/recipes/wsj.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import time from datetime import datetime, timedelta diff --git a/recipes/wsj_mag.recipe b/recipes/wsj_mag.recipe index 29712902f1..b09aeccdb1 100644 --- a/recipes/wsj_mag.recipe +++ b/recipes/wsj_mag.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import time from datetime import datetime, timedelta diff --git a/recipes/wsj_news.recipe b/recipes/wsj_news.recipe index a835b2b3b6..3c8912b7de 100644 --- a/recipes/wsj_news.recipe +++ b/recipes/wsj_news.recipe @@ -1,3 +1,5 @@ +#!/usr/bin/env python +# vim:fileencoding=utf-8 import json import time from datetime import datetime, timedelta