diff --git a/modules/getWeather.js b/modules/getWeather.js index 12edf48..e6f0348 100644 --- a/modules/getWeather.js +++ b/modules/getWeather.js @@ -2,13 +2,6 @@ const request = require("request"); const config = require("../config.json"); const Discord = require("discord.js"); -let miniMapUrl; -let lat; -let lng; -let altitude; -let coords; -let timeUpdated = new Date(); - let dateOptions = { weekday: "short", year: "numeric", diff --git a/tests.js b/tests.js deleted file mode 100644 index b30744b..0000000 --- a/tests.js +++ /dev/null @@ -1,43 +0,0 @@ -const request = require("request"); -function titleCase(title) { - if (title.length > 0) { - return title.charAt(0).toUpperCase() + title.slice(1); - } - return; -} -request.get( - `https://api.aprs.fi/api/get?name=WA5PMO-B&what=loc&apikey=118189.tA9HQbULuIDRghEx&format=json`, - function(error, res, body) { - if (error) { - console.log(error); - return; - } - let data = JSON.parse(body); - - let embedFields = []; - for (var i = 0; i < data.entries.length; i++) { - Object.keys(data.entries[i]).forEach(key => { - let field = { - name: titleCase(key), - value: data.entries[i][key] - }; - embedFields.push(field); - }); - } - const locationEmbed = { - color: "config.embed_color", - author: { - name: "APRS Bot" - }, - fields: embedFields, - image: { - url: "miniMapUrl" - }, - timestamp: new Date(), - footer: { - text: "Data sourced from https://aprs.fi/" - } - }; - console.log(locationEmbed); - } -);