commit 363a593bbb065d38aa9ece22c77e4a673152a832
parent ffb8dea6e0cc3493472c28eb838e1264bcb64517
Author: Marcel <MTRNord@users.noreply.github.com>
Date: Sun, 11 Sep 2016 21:52:12 +0200
Merge pull request #17 from MTRNord/v0.0.2
remove because api limits location
Diffstat:
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/handlers/parseNodes.js b/handlers/parseNodes.js
@@ -157,29 +157,14 @@ module.exports = {
clients = key["statistics"]["clients"]
status = key["flags"]["online"]
since = key["firstseen"]
- lat = key["nodeinfo"]["location"]["latitude"]
- lon = key["nodeinfo"]["location"]["longitude"]
- request.get('http://nominatim.openstreetmap.org/reverse?format=json&lat='+ lat + '&lon=' + lon + '&zoom=18&addressdetails=1'), function (error, response, body) {
- if (!error && response.statusCode === 200) {
- addressJson = JSON.parse(body)
- _.find(addressJson.address, function (key) {
- house_number = key["house_number"]
- road = key["road"]
- town = key["town"]
- postcode = key["postcode"]
- country = key["country"]
- adress = road + " " + house_number + ", " + postcode + " " + town + ", " + country
- if(handler == "telegram"){
- output = "<b>Name: </b>" + name + "\n<b>Router Location: </b>" + adress + "\n<b>Router Model: </b>" + router + "\n<b>Firmware Version: </b>" + version + "\n<b>Autoupdater Status: </b>" + autoupdate + "\n<b>Autoupdater Branch: </b>" + autoupdateBranch + "\n<b>Clients Connected: </b>" + clients + "\n<b>Online Status: </b>" + status + "\n<b>First Seen: </b>" + since
- }
- if(handler == "irc"){
- output = "Name: " + name + "\nRouter Location: " + adress + "\nRouter Model: " + router + "\nFirmware Version: " + version + "\nAutoupdater Status: " + autoupdate + "\nAutoupdater Branch: " + autoupdateBranch + "\nClients Connected: " + clients + "\nOnline Status: " + status + "\nFirst Seen: " + since
- }
- if(handler == "slack"){
- output = "<b>Name: </b>" + name + "\n<b>Router Location: </b>" + adress + "\n<b>Router Model: </b>" + router + "\n<b>Firmware Version: </b>" + version + "\n<b>Autoupdater Status: </b>" + autoupdate + "\n<b>Autoupdater Branch: </b>" + autoupdateBranch + "\n<b>Clients Connected: </b>" + clients + "\n<b>Online Status: </b>" + status + "\n<b>First Seen: </b>" + since
- }
- });
- }
+ if(handler == "telegram"){
+ output = "<b>Name: </b>" + name + "\n<b>Router Model: </b>" + router + "\n<b>Firmware Version: </b>" + version + "\n<b>Autoupdater Status: </b>" + autoupdate + "\n<b>Autoupdater Branch: </b>" + autoupdateBranch + "\n<b>Clients Connected: </b>" + clients + "\n<b>Online Status: </b>" + status + "\n<b>First Seen: </b>" + since
+ }
+ if(handler == "irc"){
+ output = "Name: " + name + "\nRouter Model: " + router + "\nFirmware Version: " + version + "\nAutoupdater Status: " + autoupdate + "\nAutoupdater Branch: " + autoupdateBranch + "\nClients Connected: " + clients + "\nOnline Status: " + status + "\nFirst Seen: " + since
+ }
+ if(handler == "slack"){
+ output = "<b>Name: </b>" + name + "\n<b>Router Model: </b>" + router + "\n<b>Firmware Version: </b>" + version + "\n<b>Autoupdater Status: </b>" + autoupdate + "\n<b>Autoupdater Branch: </b>" + autoupdateBranch + "\n<b>Clients Connected: </b>" + clients + "\n<b>Online Status: </b>" + status + "\n<b>First Seen: </b>" + since
}
}
});