-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
38 lines (33 loc) · 1.13 KB
/
Copy pathscript.js
File metadata and controls
38 lines (33 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//bitcoin
async function bitcoin() {
const response = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum&vs_currencies=usd');
const data = await response.json();
const cryptoList = document.getElementById('bitcoinprice');
cryptoList.innerHTML = `
<p>$${data.bitcoin.usd}</p>
`;
}
setInterval(bitcoin, 10000);
bitcoin();
//ethereum
async function ethereum() {
const response = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=bitcoin,ethereum&vs_currencies=usd');
const data = await response.json();
const cryptoList = document.getElementById('ethereumprice');
cryptoList.innerHTML = `
<p>$${data.ethereum.usd}</p>
`;
}
setInterval(ethereum, 10000);
ethereum();
//Doge
async function Doge() {
const response = await fetch('https://api.coingecko.com/api/v3/simple/price?ids=dogecoin&vs_currencies=usd');
const data = await response.json();
const cryptoList = document.getElementById('dogeprice');
cryptoList.innerHTML = `
<p>$${data.dogecoin.usd}</p>
`;
}
setInterval(Doge, 10000);
Doge();