diff --git a/recipes/ancient_egypt.recipe b/recipes/ancient_egypt.recipe index fdede7664d..c2116a00a4 100644 --- a/recipes/ancient_egypt.recipe +++ b/recipes/ancient_egypt.recipe @@ -46,13 +46,21 @@ class ancientegypt(BasicNewsRecipe): exp.name = 'p' return soup + recipe_specific_options = { + 'issue': { + 'short': 'Enter the Issue Number you want to download ', + 'long': 'For example, 136' + } + } + def parse_index(self): soup = self.index_to_soup('https://the-past.com/category/magazines/ae/') art = soup.find('article', attrs={'class':lambda x: x and 'tag-magazines' in x.split()}) url = art.h2.a['href'] - # for past editions, add url - # url = '' + d = self.recipe_specific_options.get('issue') + if d and isinstance(d, str): + url = 'https://the-past.com/magazines/ae/ancient-egypt-magazine-' + d + '/' issue = self.index_to_soup(url) ti = issue.find('h1', attrs={'class':lambda x: x and 'post-title' in x.split()}) diff --git a/recipes/bloomberg-business-week.recipe b/recipes/bloomberg-business-week.recipe index f4875b6b47..d6bfa7f12d 100644 --- a/recipes/bloomberg-business-week.recipe +++ b/recipes/bloomberg-business-week.recipe @@ -44,7 +44,7 @@ def get_contents(x): class Bloomberg(BasicNewsRecipe): title = 'Bloomberg Businessweek' - language = 'en' + language = 'en_US' __author__ = 'unkn0wn' no_stylesheets = True remove_attributes = ['style', 'height', 'width'] diff --git a/recipes/lex_fridman_podcast.recipe b/recipes/lex_fridman_podcast.recipe index 814c7d7902..5fc387f036 100644 --- a/recipes/lex_fridman_podcast.recipe +++ b/recipes/lex_fridman_podcast.recipe @@ -19,6 +19,20 @@ class lexfridman(BasicNewsRecipe): timefmt = ' [%b, %Y]' cover_url = 'https://i.scdn.co/image/ab6765630000ba8a563ebb538d297875b10114b7' + 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 = ''' .ts-name { font-weight:bold; } .ts-timestamp { font-size:small; } diff --git a/recipes/military_history.recipe b/recipes/military_history.recipe index ae35606799..09d330a09b 100644 --- a/recipes/military_history.recipe +++ b/recipes/military_history.recipe @@ -45,13 +45,21 @@ class milthist(BasicNewsRecipe): exp.name = 'p' return soup + recipe_specific_options = { + 'issue': { + 'short': 'Enter the Issue Number you want to download ', + 'long': 'For example, 136' + } + } + def parse_index(self): soup = self.index_to_soup('https://the-past.com/category/magazines/mhm/') art = soup.find('article', attrs={'class':lambda x: x and 'tag-magazines' in x.split()}) url = art.h2.a['href'] - # for past editions, add url - # url = '' + d = self.recipe_specific_options.get('issue') + if d and isinstance(d, str): + url = 'https://the-past.com/magazines/military-history-matters-' + d + '/' issue = self.index_to_soup(url) ti = issue.find('h1', attrs={'class':lambda x: x and 'post-title' in x.split()}) diff --git a/recipes/minerva_magazine.recipe b/recipes/minerva_magazine.recipe index 181d5c88f9..203d9b3520 100644 --- a/recipes/minerva_magazine.recipe +++ b/recipes/minerva_magazine.recipe @@ -45,13 +45,21 @@ class minerva(BasicNewsRecipe): exp.name = 'p' return soup + recipe_specific_options = { + 'issue': { + 'short': 'Enter the Issue Number you want to download ', + 'long': 'For example, 136' + } + } + def parse_index(self): soup = self.index_to_soup('https://the-past.com/category/magazines/minerva/') art = soup.find('article', attrs={'class':lambda x: x and 'tag-magazines' in x.split()}) url = art.h2.a['href'] - # for past editions, add url - # url = '' + d = self.recipe_specific_options.get('issue') + if d and isinstance(d, str): + url = 'https://the-past.com/magazines/minerva-magazine-' + d + '/' issue = self.index_to_soup(url) ti = issue.find('h1', attrs={'class':lambda x: x and 'post-title' in x.split()}) diff --git a/recipes/world_archeology.recipe b/recipes/world_archeology.recipe index 103f159eb5..31d467a3fd 100644 --- a/recipes/world_archeology.recipe +++ b/recipes/world_archeology.recipe @@ -47,13 +47,21 @@ class worldarch(BasicNewsRecipe): exp.name = 'p' return soup + recipe_specific_options = { + 'issue': { + 'short': 'Enter the Issue Number you want to download ', + 'long': 'For example, 136' + } + } + def parse_index(self): soup = self.index_to_soup('https://the-past.com/category/magazines/cwa/') art = soup.find('article', attrs={'class':lambda x: x and 'tag-magazines' in x.split()}) url = art.h2.a['href'] - # for past editions, add url - # url = '' + d = self.recipe_specific_options.get('issue') + if d and isinstance(d, str): + url = 'https://the-past.com/magazines/current-world-archaeology-' + d + '/' issue = self.index_to_soup(url) ti = issue.find('h1', attrs={'class':lambda x: x and 'post-title' in x.split()})