// Live Discoveries ticker. Items animate in from the bottom. // Simulates new edges arriving from the Bright Data scraper. window.DiscoveriesTicker = function DiscoveriesTicker() { const seed = window.FORGE_DISCOVERIES; const futures = window.FORGE_FUTURE_DISCOVERIES; const [items, setItems] = React.useState(seed.slice(0, 6).map((d, i) => ({ ...d, _id: i, _t: Date.now() + d.ts_offset * 1000 }))); const idRef = React.useRef(seed.length); const futIdxRef = React.useRef(0); React.useEffect(() => { const interval = setInterval(() => { const next = futures[futIdxRef.current % futures.length]; futIdxRef.current += 1; const item = { ...next, _id: idRef.current++, _t: Date.now() }; setItems(prev => [item, ...prev].slice(0, 6)); }, 5200); return () => clearInterval(interval); }, []); return (
Live Discoveries — scraper · bright data SERP {items.length} new this minute
{items.map((d) => (
{d.relation} {d.a} {d.b} {d.source} T{d.tier} {relativeTime(d._t)}
))}
); }; function relativeTime(t) { const dt = Math.floor((Date.now() - t) / 1000); if (dt < 5) return "just now"; if (dt < 60) return `${dt}s ago`; if (dt < 3600) return `${Math.floor(dt/60)}m ago`; return `${Math.floor(dt/3600)}h ago`; }