Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions UTXOracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def print_help():
-d YYYY/MM/DD Specify a UTC date to evaluate
-p /path/to/dir Specify the data directory for blk files
-rb Use last 144 recent blocks instead of date mode
--no-embed Replace the live-stream video with a link (no external requests)
"""
print(help_text)
sys.exit(0)
Expand All @@ -153,6 +154,10 @@ def print_help():
date_mode = False
block_mode = True

#did user ask to replace the embedded live-stream video with a plain link?
#(so the saved/served page makes no external requests, e.g. for private viewing)
no_embed = "--no-embed" in sys.argv

# Look for bitcoin.conf or bitcoin_rw.conf
conf_path = None
conf_candidates = ["bitcoin.conf", "bitcoin_rw.conf"]
Expand Down Expand Up @@ -1457,6 +1462,17 @@ def find_central_output(r2, price_min, price_max):
bottom_note2 = "may have node dependent differences data on the chain tip"


# The footer promotes the live-updating oracle. By default it embeds the live
# stream; --no-embed swaps the iframe for a plain link so the page makes no
# external (YouTube/Google) requests.
live_url = "https://www.youtube.com/channel/UCXN7Xa_BF7dqLErzOmS-B7Q/live"
live_embed = f'<iframe width="{width}" height="{height}" src="https://www.youtube.com/embed/live_stream?channel=UCXN7Xa_BF7dqLErzOmS-B7Q&autoplay=1&mute=1" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe>'
live_link = f'<p style="font-size:18px;"><a href="{live_url}" target="_blank" rel="noopener" style="color:cyan;">Watch the live UTXOracle on YouTube</a></p>'
live_section = f'''<h2 style="margin-top:10px; font-size:24px;">
Want a <span style="color:orange; font-size:24px;">Live Updating Oracle</span> with New Mempool Transactions?
</h2>
{live_link if no_embed else live_embed}'''

# Write the HTML code for the chart
html_content = f'''<!DOCTYPE html>

Expand Down Expand Up @@ -1755,22 +1771,7 @@ def find_central_output(r2, price_min, price_max):
<br>


<h2 style="margin-top:10px; font-size:24px;">
Want a
<span style="color:orange; font-size:24px;">Live Updating Oracle</span>
with New Mempool Transactions?
</h2>


<iframe
width="{width}"
height="{height}"
src="https://www.youtube.com/embed/live_stream?channel=UCXN7Xa_BF7dqLErzOmS-B7Q&autoplay=1&mute=1"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen

</iframe>
{live_section}



Expand Down