kopia lustrzana https://github.com/dgtlmoon/changedetection.io
Re #117 - dont re-encode single value types, looks better in the diff
rodzic
ae0fc5ec0f
commit
655a350f50
|
@ -99,7 +99,15 @@ class perform_site_check():
|
||||||
json_data = json.loads(html)
|
json_data = json.loads(html)
|
||||||
jsonpath_expression = parse(css_filter_rule.replace('json:',''))
|
jsonpath_expression = parse(css_filter_rule.replace('json:',''))
|
||||||
match = jsonpath_expression.find(json_data)
|
match = jsonpath_expression.find(json_data)
|
||||||
stripped_text_from_html = json.dumps(match[0].value, indent=4)
|
if match:
|
||||||
|
# @todo isnt there a better way to say this?
|
||||||
|
if type(match[0].value) == int or type(match[0].value) == str or type(match[0].value) == float:
|
||||||
|
# A single string, just use that as a string
|
||||||
|
# Be sure it becomes str
|
||||||
|
stripped_text_from_html = str(match[0].value)
|
||||||
|
else:
|
||||||
|
# JSON encoded struct as str
|
||||||
|
stripped_text_from_html = json.dumps(match[0].value, indent=4)
|
||||||
|
|
||||||
is_html = False
|
is_html = False
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue