{"id":190,"date":"2025-12-10T19:35:28","date_gmt":"2025-12-11T03:35:28","guid":{"rendered":"https:\/\/homelandz.opensim.fun\/?page_id=190"},"modified":"2025-12-11T20:56:29","modified_gmt":"2025-12-12T04:56:29","slug":"beacon-tracker","status":"publish","type":"page","link":"https:\/\/homelandz.opensim.fun\/index.php\/beacon-tracker\/","title":{"rendered":"Homelandz Beacon Tracker"},"content":{"rendered":"\n\n<d<div style=\"font-family:Arial,sans-serif;max-width:100%;margin:0 auto;padding:10px;\">\n  \n  <div style=\"text-align:center;margin:30px 0;\">\n    <input type=\"text\" id=\"searchBox\" placeholder=\"Search region or grid...\"\n           style=\"padding:16px;font-size:18px;width:90%;max-width:600px;border:3px solid #5e35b1;border-radius:12px;text-align:center;\">\n    <p style=\"margin:20px 0;font-size:16px;\"><strong>Auto-refresh every 30s<\/strong> | Last update: <span id=\"last\" style=\"color:#5e35b1;font-weight:bold;\">never<\/span><\/p>\n  <\/div>\n\n  <div style=\"overflow-x:auto;\">\n    <table style=\"width:100%;border-collapse:collapse;background:white;box-shadow:0 6px 20px rgba(0,0,0,0.15);font-size:15px;\">\n      <thead>\n        <tr style=\"background:#5e35b1;color:white;\">\n          <th style=\"padding:16px;\">Time<\/th>\n          <th style=\"padding:16px;\">Region<\/th>\n          <th style=\"padding:16px;\">Grid<\/th>\n          <th style=\"padding:16px;\">X<\/th>\n          <th style=\"padding:16px;\">Y<\/th>\n          <th style=\"padding:16px;\">Z<\/th>\n          <th style=\"padding:16px;\">Go<\/th>\n        <\/tr>\n      <\/thead>\n      <tbody id=\"beaconsBody\"><\/tbody>\n    <\/table>\n  <\/div>\n<\/div>\n\n<script>\nconst WEBAPP_URL = \"https:\/\/script.google.com\/macros\/s\/AKfycbyzqTd7d2MOG0Ay94TUdY2LxXRBRhH1tTNzs_mZHzeE8rpLfR4c7qniT86OOm8yCQoZ\/exec\";\nlet allData = [];\n\nfunction getHopHost(hostname) {\n    hostname = hostname.trim().toLowerCase();\n    if (hostname.includes(\"homelandz.opensim.fun\")) return \"homelandz.opensim.fun:8802\";\n    if (hostname.includes(\"tenthdimension.org\")) return \"grid.tenthdimension.org:8002\";\n    if (hostname.includes(\"wolfterritories.org\")) return \"grid.wolfterritories.org:8002\";\n    if (hostname.includes(\"osgrid.org\")) return \"hg.osgrid.org:80\";\n    return hostname.includes(\":\") ? hostname : hostname + \":8002\";\n}\n\nfunction render(data) {\n    const tbody = document.getElementById(\"beaconsBody\");\n    tbody.innerHTML = data.length === 0\n        ? `<tr><td colspan=\"7\" style=\"padding:60px;font-size:20px;color:#999;\">No beacons found<\/td><\/tr>`\n        : data.map(d => {\n            const region = encodeURIComponent(d.region);\n            const hopHost = getHopHost(d.grid.trim());\n            const hopUrl = `hop:\/\/${hopHost}\/${region}\/${d.x}\/${d.y}\/${d.z}`;\n           \n            return `<tr>\n                <td style=\"padding:14px;\">${new Date(d.timestamp).toLocaleString()}<\/td>\n                <td style=\"padding:14px;font-weight:600;\">${d.region}<\/td>\n                <td style=\"padding:14px;\">${d.grid.trim()}<\/td>\n                <td style=\"padding:14px;\">${d.x}<\/td>\n                <td style=\"padding:14px;\">${d.y}<\/td>\n                <td style=\"padding:14px;\">${d.z}<\/td>\n                <td style=\"padding:14px;\">\n                    <div style=\"display:flex;flex-direction:column;gap:14px;align-items:center;\">\n                        <a href=\"${hopUrl}\" target=\"_blank\" style=\"background:#28a745;color:white;padding:14px 40px;border-radius:10px;text-decoration:none;font-size:16px;width:240px;text-align:center;\">Teleport<\/a>\n                        <button onclick=\"navigator.clipboard.writeText('${hopUrl}').then(()=>alert('Copied: ${hopUrl}'))\" style=\"background:#007bff;color:white;padding:14px 40px;border:none;border-radius:10px;cursor:pointer;font-size:16px;width:240px;\">Copy hop URL<\/button>\n                    <\/div>\n                <\/td>\n            <\/tr>`;\n        }).join('');\n}\n\nfunction filterAndRender() {\n    const q = document.getElementById(\"searchBox\").value.toLowerCase().trim();\n    const filtered = q ? allData.filter(i =>\n        i.region.toLowerCase().includes(q) || i.grid.toLowerCase().includes(q)\n    ) : allData;\n    render(filtered);\n}\n\nfunction loadData() {\n    fetch(WEBAPP_URL + \"?mode=json\")\n        .then(r => r.json())\n        .then(data => {\n            data.sort((a,b) => new Date(b.timestamp) - new Date(a.timestamp));\n            allData = data;\n            filterAndRender();\n            document.getElementById(\"last\").textContent = new Date().toLocaleTimeString();\n        })\n        .catch(() => alert(\"Could not load data\"));\n}\n\ndocument.getElementById(\"searchBox\").addEventListener(\"input\", filterAndRender);\nsetInterval(loadData, 30000);\nloadData();\n<\/script>","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"saved_in_kubio":true,"footnotes":""},"class_list":["post-190","page","type-page","status-publish","hentry"],"kubio_ai_page_context":{"short_desc":"","purpose":"general"},"_links":{"self":[{"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/pages\/190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/comments?post=190"}],"version-history":[{"count":37,"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/pages\/190\/revisions"}],"predecessor-version":[{"id":260,"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/pages\/190\/revisions\/260"}],"wp:attachment":[{"href":"https:\/\/homelandz.opensim.fun\/index.php\/wp-json\/wp\/v2\/media?parent=190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}