2022-02-05 15:54:14 +00:00
|
|
|
// GridTracker Copyright © 2022 GridTracker.org
|
|
|
|
// All rights reserved.
|
|
|
|
// See LICENSE for more information.
|
|
|
|
|
2022-02-05 17:36:52 +00:00
|
|
|
var g_potaPlaces = null;
|
|
|
|
var g_potaSpots = null;
|
2022-02-05 15:54:14 +00:00
|
|
|
|
|
|
|
function g_getPotaPlaces()
|
|
|
|
{
|
|
|
|
// get list of all parks
|
|
|
|
// we need to see if ever run and update 1x a week
|
|
|
|
}
|
|
|
|
|
2022-02-05 18:08:25 +00:00
|
|
|
function g_ingestPotaSpots(buffer)
|
2022-02-05 17:36:52 +00:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
|
|
|
g_potaSpots = JSON.parse(buffer);
|
|
|
|
}
|
|
|
|
catch (e)
|
|
|
|
{
|
|
|
|
// can't write, somethings broke
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-02-05 15:54:14 +00:00
|
|
|
function g_getPotaSpots()
|
|
|
|
{
|
2022-02-05 17:36:52 +00:00
|
|
|
if (g_mapSettings.offlineMode == false)
|
|
|
|
{
|
|
|
|
getBuffer(
|
|
|
|
"https://api.pota.app/spot/activator",
|
|
|
|
g_ingestPotaSpots,
|
|
|
|
null,
|
2022-02-05 18:08:25 +00:00
|
|
|
"https",
|
|
|
|
443
|
2022-02-05 17:36:52 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
setTimeout(g_getPotaSpots, 300000);
|
|
|
|
}
|
2022-02-05 15:54:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function g_sendPotaSpot()
|
|
|
|
{
|
|
|
|
// if Pota spotting enabled, and we have enough info, send a spot to Pota
|
|
|
|
}
|