mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Update specific_options
thepast.com recipes
This commit is contained in:
parent
788580fd9c
commit
c3aa2b7119
@ -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()})
|
||||
|
@ -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']
|
||||
|
@ -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; }
|
||||
|
@ -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()})
|
||||
|
@ -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()})
|
||||
|
@ -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()})
|
||||
|
Loading…
x
Reference in New Issue
Block a user