Skip to content

Instantly share code, notes, and snippets.

@abachman
Created January 5, 2021 02:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abachman/f8d0fe95200912d037cbc70a1c3beb5f to your computer and use it in GitHub Desktop.
Save abachman/f8d0fe95200912d037cbc70a1c3beb5f to your computer and use it in GitHub Desktop.
new tab Template block demos

cat facts

url: https://cat-fact.herokuapp.com/facts

code:

<div style="border: 1px solid black;padding: 5px;">
  <h3 style="padding:0;margin:0">CAT FACTS</h3>
  {% for fact in data %}
    {{ fact.text }}<br />
  {% endfor %}
</div>

random cat

url: https://aws.random.cat/meow

code:

<img style="max-width: 100%; max-height: 100%" src="{{ file }}" />

coin facts

based on https://nomics.com/docs/#operation/getCurrenciesTicker, get an API token at https://p.nomics.com/cryptocurrency-bitcoin-api/

url: https://api.nomics.com/v1/currencies/ticker?key=...&ids=BTC&interval=1d&convert=USD&per-page=1&page=1

code:

<h3>COIN FACTS</h3>
<p>1 BTC to USD ${{ data.first.price | floor }}</p>
<p>as of {{ data.first.price_date }}</p>

More APIs

You can find a bunch more public APIs here: https://github.com/public-apis/public-apis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment