Spaces:
Running
Running
Commit History
-
please pull the data needed from binance api or cryptoglass.com
Verified signature34912d5 -
please make the date feed come in from live source , please circumvent sandbox obstacles in any way possibleto make the site online and live
Verified signatureacbbed3 -
In your HTML, replace the entire block:β
Verified signaturetry { response = await axios.get('http://localhost:7860/api/data'); } catch (apiError) { console.log('Local API error, using mock data'); response = { data: { ...random mock values... } }; } with this: // Fetch from same host (works locally or on Hugging Face) const response = await axios.get('/api/data'); const data = response.data; updateDashboard(data);45fe2f8 -
Goal:β
Verified signatureCreate a live but stable crypto dashboard that fetches Binance market data, calculates PHI and related metrics, stores them in cache, and displays smooth updates through index.html. 1. Folder Layout /cryptopulse-navigator β βββ app.py βββ Procfile βββ requirements.txt β βββ /data β βββ cache.json β βββ history.json β βββ /templates β βββ index.html β βββ /static βββ style.css 2. app.py (backend) from flask import Flask, jsonify, render_template import requests, math, statistics, time, os, json app = Flask(__name__) DATA_DIR = "data" CACHE_FILE = os.path.join(DATA_DIR, "cache.json") HISTORY_FILE = os.path.join(DATA_DIR, "history.json") os.makedirs(DATA_DIR, exist_ok=True) def fetch_json(url): try: r = requests.get(url, timeout=5) r.raise_for_status() return r.json() except Exception: return {} def compute_phi_metrics(symbol): ticker = fetch_json(f"https://api.binance.com/api/v3/ticker/24hr?symbol={symbol}") klines = fetch_jβ¦b2eed1c -
Manual changes saved
Verified signature83d2bf9 -
1. Add a backend (Flask or FastAPI)β
Verified signatureCreate a file called app.py next to your HTML and run it with python app.py. from flask import Flask, jsonify import requests, math, random app = Flask(__name__) @app.route("/api/data") def get_data(): # Basic fallback values if CoinGlass blocks try: btc = requests.get("https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT").json() eth = requests.get("https://api.binance.com/api/v3/ticker/24hr?symbol=ETHUSDT").json() except: btc, eth = {}, {} # Simulate scraped metrics data = { "phi_score": random.uniform(25, 85), "volx": random.uniform(20, 80), "momx": random.uniform(0.1, 0.9), "fbs": random.uniform(-0.001, 0.002), "lpi": random.uniform(20, 70), "btc": { "price": float(btc.get("lastPrice", 67000)), "change_24h": float(btc.get("priceChangePercent", -2.3)), "dominance": 52.1, "funding_rate": 0.0001, "open_interest": 13_000_000_0β¦e9196f5 -
Title: CryptoPulse Navigator β Intelligent CoinGlass Dashboardβ
Verified signatureInstruction: Build and host a full-stack crypto intelligence dashboard that scrapes and visualizes live market data from https://www.coinglass.com/ . Use the latest market overview page to extract all real-time data available (funding rates, long/short ratio, liquidation volume, open interest, top gainers/losers, BTC/ETH metrics, etc.). The goal is to automatically scrape, calculate, store, and display actionable indicators in a dynamic dashboard called CryptoPulse Navigator. Follow these build requirements and logic exactly: 1. Data Collection Scrape target: https://www.coinglass.com/ β extract all tables and cards containing: BTC/ETH prices, dominance, and funding rates Global long vs short ratio Open interest (24h change %) Liquidation data (long vs short) Exchange funding rate averages (Binance, OKX, Bybit) Top gainers/losers (symbols and % change) Stablecoin dominance Fear & Greed Index if visible Scraping method: Use requests + BeautifulSoup4 (or Playwright if JS rβ¦e74fc4b -
initial commit
Verified signaturebbce23f