import datetime import json import urllib.parse from flask import render_template def domains(domains, mobile=False): html = '' for domain in domains: owner = domain['owner'] if 'index' in owner: if owner['index'] == 0: continue expires = domain['stats'] if 'daysUntilExpire' in expires: expires = expires['daysUntilExpire'] paid = domain['value'] paid = paid / 1000000 if not mobile: html += f'
Returns: {returns}
' html += f'Returns: {returns}
' html += f'' html += f'' return html def plugin_output(outputs, returns): html = '' for returnOutput in returns: if returnOutput not in outputs: continue html += f'{output}
' elif returns[returnOutput]["type"] == "tx": html += render_template('components/tx.html', tx=output) elif returns[returnOutput]["type"] == "dns": output = json.loads(output) html += render_template('components/dns-output.html', dns=dns(output)) html += f'