Skip to content

Commit

Permalink
added ATH
Browse files Browse the repository at this point in the history
  • Loading branch information
besoeasy authored Jan 2, 2024
1 parent d80ecfd commit ca3b42b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<script type="module" src="/src/main.js"></script>

<script>
if (Math.random() < 0.02) {
if (Math.random() < 0.05) {
localStorage.clear();
location.reload();
}
Expand Down
12 changes: 12 additions & 0 deletions src/func.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,15 @@ export async function getBitcoinPrice() {

return btcp.data[0].last || 1;
}

export async function getCoingecko() {
const coingeckdata = await axiosCall(`https://api.coingecko.com/api/v3/coins/bitcoin?tickers=false&market_data=true`);

const mardat = coingeckdata.market_data;

return {
price: mardat.current_price.usd,
ath: mardat.ath.usd,
athdate: mardat.ath_date.usd,
};
}

0 comments on commit ca3b42b

Please sign in to comment.