<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Captain BTC Signal</title>
<style>
body {
background: #0a0a0a;
color: white;
font-family: Arial, sans-serif;
text-align: center;
padding-top: 60px;
}
h1 { color: #00bcd4; }
#signal { font-size: 28px; margin-top: 20px; }
#fear { color: #ccc; margin-top: 10px; }
#time { color: #777; margin-top: 10px; font-size: 14px; }
</style>
</head>
<body>
<h1>Captain BTC Signal</h1>
<div id="signal">Fetching data...</div>
<div id="fear"></div>
<div id="time"></div>
<script>
async function getData() {
document.getElementById("signal").innerText = "Fetching data...";
try {
// get BTC price
const res = await fetch("https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd");
const data = await res.json();
const btc = data.bitcoin.usd;
// fake simple logic for now
const signal = btc > 60000 ? "✅ BTC will go up" : "🔻 BTC will go down";
// Fear & Greed index
const fg = await fetch("https://api.alternative.me/fng/");
const fgdata = await fg.json();
const fgvalue = fgdata.data[0].value + " – " + fgdata.data[0].value_classification;
document.getElementById("signal").innerText = signal;
document.getElementById("fear").innerText = "Fear & Greed: " + fgvalue;
document.getElementById("time").innerText = "Last updated: " + new Date().toLocaleTimeString();
} catch (err) {
document.getElementById("signal").innerText = "Error fetching data";
}
}
getData();
setInterval(getData, 60000);
</script>
</body>
</html>