mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
update bloomberg
This commit is contained in:
parent
5f69db86ea
commit
96aead4da9
@ -30,7 +30,7 @@ def get_contents(x):
|
||||
return '<blockquote class="col">' + x.get('value', '') + ''.join(map(get_contents, x.get('content', ''))) + '</blockquote>'
|
||||
elif otype == 'media':
|
||||
if x['subType'] == 'photo':
|
||||
return '<div><div class="img"><img src="{}"></div><div class="cap">{}<div>{}</div></div></div>'.format(
|
||||
return '<div><div class="img"><img src="{}"></div><div class="cap">{} <span>{}</span></div></div>'.format(
|
||||
x['data']['photo']['src'], x['data']['photo']['caption'], x['data']['photo']['credit'])
|
||||
elif x['subType'] == 'chart':
|
||||
if x['data'] and x['data']['chart']:
|
||||
@ -78,7 +78,7 @@ class Bloomberg(BasicNewsRecipe):
|
||||
extra_css = '''
|
||||
.auth {font-size:small; font-weight:bold;}
|
||||
.time, .chart, .css--lede-byline, .css--lede-timestamp {font-size:small;}
|
||||
.subhead {font-style:italic; color:#404040;}
|
||||
.subhead, .cap span {font-style:italic; color:#404040;}
|
||||
em, .col {color:#202020;}
|
||||
.cat {font-size:small; color:gray;}
|
||||
.news-figure-caption-text, .cap, .img, .css--caption-outer-wrapper {font-size:small; text-align:center;}
|
||||
|
@ -31,7 +31,7 @@ def get_contents(x):
|
||||
return '<blockquote class="col">' + x.get('value', '') + ''.join(map(get_contents, x.get('content', ''))) + '</blockquote>'
|
||||
elif otype == 'media':
|
||||
if x['subType'] == 'photo':
|
||||
return '<div><div class="img"><img src="{}"></div><div class="cap">{}<div>{}</div></div></div>'.format(
|
||||
return '<div><div class="img"><img src="{}"></div><div class="cap">{} <span>{}</span></div></div>'.format(
|
||||
x['data']['photo']['src'], x['data']['photo']['caption'], x['data']['photo']['credit'])
|
||||
elif x['subType'] == 'chart':
|
||||
if x['data'] and x['data']['chart']:
|
||||
@ -77,7 +77,7 @@ class Bloomberg(BasicNewsRecipe):
|
||||
extra_css = '''
|
||||
.auth {font-size:small; font-weight:bold;}
|
||||
.time, .chart {font-size:small;}
|
||||
.subhead {font-style:italic; color:#404040;}
|
||||
.subhead, .cap span {font-style:italic; color:#404040;}
|
||||
em, .col {color:#202020;}
|
||||
.cat {font-size:small; color:gray;}
|
||||
.news-figure-caption-text, .cap, .img {font-size:small; text-align:center;}
|
||||
|
@ -19,7 +19,7 @@ def classes(classes):
|
||||
def extract_json(raw):
|
||||
s = raw.find("window['__natgeo__']")
|
||||
script = raw[s:raw.find('</script>', s)]
|
||||
data = json.loads(script[script.find('{'):].rstrip(';'))['page']['content']['prismarticle']
|
||||
return json.loads(script[script.find('{'):].rstrip(';'))['page']['content']['prismarticle']
|
||||
|
||||
|
||||
def parse_contributors(grp):
|
||||
|
@ -18,7 +18,7 @@ def classes(classes):
|
||||
def extract_json(raw):
|
||||
s = raw.find("window['__natgeo__']")
|
||||
script = raw[s:raw.find('</script>', s)]
|
||||
data = json.loads(script[script.find('{'):].rstrip(';'))['page']['content']['prismarticle']
|
||||
return json.loads(script[script.find('{'):].rstrip(';'))['page']['content']['prismarticle']
|
||||
|
||||
|
||||
def parse_contributors(grp):
|
||||
|
@ -23,7 +23,7 @@ def classes(classes):
|
||||
def extract_json(raw):
|
||||
s = raw.find("window['__natgeo__']")
|
||||
script = raw[s:raw.find('</script>', s)]
|
||||
data = json.loads(script[script.find('{'):].rstrip(';'))['page']['content']['prismarticle']
|
||||
return json.loads(script[script.find('{'):].rstrip(';'))['page']['content']['prismarticle']
|
||||
|
||||
|
||||
def parse_contributors(grp):
|
||||
|
Loading…
x
Reference in New Issue
Block a user