|
| 1 | +<!DOCTYPE html> |
| 2 | +<html lang="en"> |
| 3 | + |
| 4 | +<head> |
| 5 | + <meta charset="UTF-8"> |
| 6 | + <!-- <script src="https://unpkg.com/htmx.org@2.0.4" |
| 7 | + integrity="sha384-HGfztofotfshcF7+8n44JQL2oJmowVChPTg48S+jvZoztPfvwD79OC/LTtG6dMp+" |
| 8 | +crossorigin="anonymous"></script> --> |
| 9 | + <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> |
| 10 | + <link rel="stylesheet" type="text/css" href="/style.css" /> |
| 11 | + <link rel="preconnect" href="https://fonts.googleapis.com"> |
| 12 | + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> |
| 13 | + <link href="https://fonts.googleapis.com/css2?family=Doto:wght@100..900&display=swap" rel="stylesheet"> |
| 14 | + <title>Benalleng</title> |
| 15 | +</head> |
| 16 | + |
| 17 | +<body> |
| 18 | + <h1 class="name-header">Ben Allen G</h1> |
| 19 | + <div class="ticker"> |
| 20 | + <hr /> |
| 21 | + <p class="marquee"> |
| 22 | + <span id="marquee"></span> |
| 23 | + </p> |
| 24 | + <p class="marquee marquee2"> |
| 25 | + <span id="marquee2"></span> |
| 26 | + </p> |
| 27 | + <br /> |
| 28 | + <hr /> |
| 29 | + </div> |
| 30 | + <div class="container"> |
| 31 | + <div class="dashboard"> |
| 32 | + <a class="link" target="_blank" href="/bitcoin.pdf">bitcoin pdf</a> |
| 33 | + <a class="link" target="_blank" href="/gpg.txt">GPG public key</a> |
| 34 | + <a class="link" href="mailto:benalleng@gmail.com">Contact</a> |
| 35 | + <a class="link" target="_blank" href="https://github.com/benalleng">Github</a> |
| 36 | + </div> |
| 37 | + <div class="content-main"> |
| 38 | + <p class="paragraph-main"> |
| 39 | + <span class="paragraph-internal first">You've found me, Nice.</span> |
| 40 | + <span class="paragraph-internal">I'm working on expanding the Privacy and fungibility of |
| 41 | + bitcoin</span> |
| 42 | + <span class="paragraph-internal">As well as exploring the securtiy vulernabilities |
| 43 | + through program logic and chaos</span> |
| 44 | + <span class="paragraph-internal">s</span> |
| 45 | + <span class="paragraph-internal">as</span> |
| 46 | + <span class="paragraph-internal">ass</span> |
| 47 | + <span class="paragraph-internal">asss</span> |
| 48 | + <span class="paragraph-internal">assss</span> |
| 49 | + <span class="paragraph-internal">asssss</span> |
| 50 | + <span class="paragraph-internal last">updated on </span> |
| 51 | + </p> |
| 52 | + </div> |
| 53 | + </div> |
| 54 | +</body> |
| 55 | + |
| 56 | +<script> |
| 57 | + $(document).ready(function () { |
| 58 | + function updateData() { |
| 59 | + var miningAdjutmentPath = "https://mempool.space/api/v1/difficulty-adjustment"; |
| 60 | + var pricePath = "https://mempool.space/api/v1/prices"; |
| 61 | + let blockTipHeightPath = "https://mempool.space/api/blocks/tip/height"; |
| 62 | + let recommendedFeePath = "https://mempool.space/api/v1/fees/recommended"; |
| 63 | + |
| 64 | + $.when( |
| 65 | + $.getJSON(miningAdjutmentPath), |
| 66 | + $.getJSON(pricePath), |
| 67 | + $.getJSON(blockTipHeightPath), |
| 68 | + $.getJSON(recommendedFeePath), |
| 69 | + ).done(function (miningData, priceData, blockHeightData, recommendedFeeData) { |
| 70 | + console.log(recommendedFeeData[0].minimumFee) |
| 71 | + var priceTextContent = "Bitcoin Price" + " - " + "$" + JSON.stringify(priceData[0].USD) + " - " + "Sats per Dollar" + " - " + JSON.stringify(Math.round(100000000 / priceData[0].USD)) + " -\u00A0"; |
| 72 | + |
| 73 | + var difficultyTextContent = "Estimated Difficulty Change" + " - " + JSON.stringify(parseFloat(miningData[0].difficultyChange.toFixed(1))) + "%" + " - " + "Retarget Height" + " - " + JSON.stringify(miningData[0].nextRetargetHeight) + " - " + "Blocks to Retarget" + " - " + JSON.stringify(miningData[0].remainingBlocks) + " -\u00A0"; |
| 74 | + |
| 75 | + var blockTipHeightContent = "Current Block Height" + " - " + JSON.stringify(blockHeightData[0]) + " -\u00A0"; |
| 76 | + |
| 77 | + var recommendedFeeContent = "Minumum Fee" + " - " + JSON.stringify(recommendedFeeData[0].minimumFee) + " sats/vb" + " - " + "Fastest Fee" + " - " + JSON.stringify(recommendedFeeData[0].fastestFee) + " sats/vb" + " -\u00A0"; |
| 78 | + |
| 79 | + var combinedTextContent = priceTextContent + difficultyTextContent + blockTipHeightContent + recommendedFeeContent; |
| 80 | + |
| 81 | + $("#marquee").empty().append(combinedTextContent); |
| 82 | + $("#marquee2").empty().append(combinedTextContent); |
| 83 | + }).fail(function () { |
| 84 | + console.error("Failed to fetch data from one of the APIs."); |
| 85 | + }); |
| 86 | + } |
| 87 | + |
| 88 | + function fetchCommit() { |
| 89 | + var githubApiPath = "https://api.github.com/repos/benalleng/benalleng-site/commits/main" |
| 90 | + |
| 91 | + $.when() |
| 92 | + } |
| 93 | + |
| 94 | + updateData(); |
| 95 | + setInterval(updateData, 30000); |
| 96 | + }); |
| 97 | +</script> |
| 98 | + |
| 99 | +</html> |
0 commit comments