blob: 3e0fee4ce58f72e0fff7f5573d9ca0fbdb4184ef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
import app from "$app";
import redis from "$lib/redis";
import axios from "axios";
let locations;
app.get("/locations", async (req, res) => {
res.send({ locations });
});
let getLocations = async () => {
let { data } = await axios.get('https://api.btcmap.org/v2/elements?updated_since=2022-09-19');
locations = data.filter(
(l) => l['osm_json'].tags && l['osm_json'].tags['payment:coinos'] === 'yes'
);
setTimeout(getLocations, 60000);
}
getLocations();
|