{"id":4700,"date":"2026-02-16T08:32:41","date_gmt":"2026-02-16T08:32:41","guid":{"rendered":"https:\/\/empeiroscapital.com\/?page_id=4700"},"modified":"2026-02-16T11:15:11","modified_gmt":"2026-02-16T11:15:11","slug":"4700-2","status":"publish","type":"page","link":"https:\/\/empeiroscapital.com\/?page_id=4700","title":{"rendered":"Live Asset Flow Tracker"},"content":{"rendered":"\n<style>\n    .at-final-wrapper {\n        background: #f4f7fe;\n        padding: 30px;\n        border-radius: 15px;\n        font-family: 'Segoe UI', Roboto, sans-serif;\n        color: #333;\n        border: 2px solid #667eea;\n    }\n\n    .at-section-title {\n        font-weight: bold;\n        color: #667eea;\n        margin: 15px 0 10px 0;\n        font-size: 14px;\n        text-transform: uppercase;\n    }\n\n    \/* Turning dropdowns into clickable button grids *\/\n    .at-radio-grid {\n        display: grid;\n        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));\n        gap: 10px;\n        margin-bottom: 20px;\n    }\n\n    .at-option {\n        position: relative;\n    }\n\n    .at-option input {\n        position: absolute;\n        opacity: 0;\n        cursor: pointer;\n    }\n\n    .at-label {\n        display: block;\n        padding: 10px;\n        background: white;\n        border: 2px solid #e0e0e0;\n        border-radius: 8px;\n        text-align: center;\n        font-size: 13px;\n        font-weight: 600;\n        cursor: pointer;\n        transition: 0.2s;\n    }\n\n    .at-option input:checked + .at-label {\n        border-color: #667eea;\n        background: #667eea;\n        color: white;\n    }\n\n    .at-fetch-btn {\n        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n        color: white !important;\n        width: 100%;\n        padding: 18px;\n        border: none;\n        border-radius: 10px;\n        font-size: 16px;\n        font-weight: bold;\n        cursor: pointer;\n        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);\n    }\n\n    .at-fetch-btn:disabled { opacity: 0.5; cursor: wait; }\n\n    \/* Results *\/\n    .res-card { background: white; padding: 20px; border-radius: 12px; margin-top: 15px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }\n    .pos { color: #10b981; font-weight: bold; }\n    .neg { color: #ef4444; font-weight: bold; }\n<\/style>\n\n<div class=\"at-final-wrapper\">\n    <h2 style=\"text-align:center; margin-bottom:20px;\">\ud83d\udcb0 Asset Flow Tracker<\/h2>\n\n    <div class=\"at-section-title\">1. Data Focus<\/div>\n    <div class=\"at-radio-grid\">\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"dataType\" value=\"flows\" checked>\n            <span class=\"at-label\">ETF Flows<\/span>\n        <\/label>\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"dataType\" value=\"markets\">\n            <span class=\"at-label\">Markets<\/span>\n        <\/label>\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"dataType\" value=\"sectors\">\n            <span class=\"at-label\">Sectors<\/span>\n        <\/label>\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"dataType\" value=\"crypto\">\n            <span class=\"at-label\">Crypto<\/span>\n        <\/label>\n    <\/div>\n\n    <div class=\"at-section-title\">2. Timeframe<\/div>\n    <div class=\"at-radio-grid\">\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"timeframe\" value=\"recent\" checked>\n            <span class=\"at-label\">Week<\/span>\n        <\/label>\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"timeframe\" value=\"monthly\">\n            <span class=\"at-label\">Month<\/span>\n        <\/label>\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"timeframe\" value=\"ytd\">\n            <span class=\"at-label\">YTD<\/span>\n        <\/label>\n    <\/div>\n\n    <div class=\"at-section-title\">3. Region<\/div>\n    <div class=\"at-radio-grid\">\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"region\" value=\"global\" checked>\n            <span class=\"at-label\">Global<\/span>\n        <\/label>\n        <label class=\"at-option\">\n            <input type=\"radio\" name=\"region\" value=\"us\">\n            <span class=\"at-label\">USA<\/span>\n        <\/label>\n    <\/div>\n\n    <button class=\"at-fetch-btn\" id=\"atFetchBtn\" onclick=\"executeTracker()\">\ud83d\udd04 Fetch Live Market Data<\/button>\n\n    <div id=\"atStatus\" style=\"display:none; text-align:center; margin-top:20px;\">\n        <p>\ud83e\udd16 AI is searching the live web&#8230; please wait 30s.<\/p>\n    <\/div>\n\n    <div id=\"atOutput\"><\/div>\n<\/div>\n\n<script>\nasync function executeTracker() {\n    const btn = document.getElementById('atFetchBtn');\n    const out = document.getElementById('atOutput');\n    const status = document.getElementById('atStatus');\n\n    \/\/ Get selected values from Radios\n    const type = document.querySelector('input[name=\"dataType\"]:checked').value;\n    const time = document.querySelector('input[name=\"timeframe\"]:checked').value;\n    const reg = document.querySelector('input[name=\"region\"]:checked').value;\n\n    btn.disabled = true;\n    status.style.display = 'block';\n    out.innerHTML = '';\n\n    try {\n        const fd = new FormData();\n        fd.append('action', 'fetch_market_data');\n        fd.append('dataType', type);\n        fd.append('timeframe', time);\n        fd.append('region', reg);\n\n        const response = await fetch('\/wp-admin\/admin-ajax.php', { method: 'POST', body: fd });\n        const res = await response.json();\n        \n        if (!res.success) throw new Error(\"API Connection Error\");\n\n        let html = '<div style=\"margin-top:20px;\">';\n        res.data.assetClasses.forEach(item => {\n            const isPos = item.flow.includes('+');\n            html += `<div class=\"res-card\">\n                <h3 style=\"margin:0 0 10px 0;\">\ud83d\udcca ${item.name}<\/h3>\n                Flow: <span class=\"${isPos ? 'pos' : 'neg'}\">${item.flow}<\/span>\n                <p style=\"font-size:13px; color:#666; margin-top:5px;\">${item.trend}\n            <\/div>`;\n        });\n        out.innerHTML = html + '<\/div>';\n    } catch (e) {\n        alert(\"Check Plugin Activation or API Key: \" + e.message);\n    } finally {\n        btn.disabled = false;\n        status.style.display = 'none';\n    }\n}\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>\ud83d\udcb0 Asset Flow Tracker 1. Data Focus ETF Flows Markets Sectors Crypto 2. Timeframe Week Month YTD 3. Region Global USA \ud83d\udd04 Fetch Live Market Data \ud83e\udd16 AI is searching the live web&#8230; please wait 30s.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-4700","page","type-page","status-publish","hentry","entry"],"_links":{"self":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages\/4700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4700"}],"version-history":[{"count":11,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages\/4700\/revisions"}],"predecessor-version":[{"id":4725,"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=\/wp\/v2\/pages\/4700\/revisions\/4725"}],"wp:attachment":[{"href":"https:\/\/empeiroscapital.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}