freifunk-bot.meta

Issues/PRs archive for MTRNord/freifunk-bot
git clone git://archive.git.mtrnord.blog/MTRNord/freifunk-bot.meta.git
Log | Files | Refs

17.diff (3812B)


      1 diff --git a/handlers/parseNodes.js b/handlers/parseNodes.js
      2 index 209ccf1..0f269e3 100644
      3 --- a/handlers/parseNodes.js
      4 +++ b/handlers/parseNodes.js
      5 @@ -157,29 +157,14 @@ module.exports = {
      6                    clients = key["statistics"]["clients"]
      7                    status = key["flags"]["online"]
      8                    since = key["firstseen"]
      9 -                  lat = key["nodeinfo"]["location"]["latitude"]
     10 -                  lon = key["nodeinfo"]["location"]["longitude"]
     11 -                  request.get('http://nominatim.openstreetmap.org/reverse?format=json&lat='+ lat + '&lon=' + lon + '&zoom=18&addressdetails=1'), function (error, response, body) {
     12 -                    if (!error && response.statusCode === 200) {
     13 -                      addressJson = JSON.parse(body)
     14 -                      _.find(addressJson.address, function (key) {
     15 -                        house_number = key["house_number"]
     16 -                        road = key["road"]
     17 -                        town = key["town"]
     18 -                        postcode = key["postcode"]
     19 -                        country = key["country"]
     20 -                        adress = road + " " + house_number + ", " + postcode + " " + town + ", " + country
     21 -                        if(handler == "telegram"){
     22 -                          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
     23 -                        }
     24 -                        if(handler == "irc"){
     25 -                          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
     26 -                        }
     27 -                        if(handler == "slack"){
     28 -                          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
     29 -                        }
     30 -                      });
     31 -                    }
     32 +                  if(handler == "telegram"){
     33 +                    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
     34 +                  }
     35 +                  if(handler == "irc"){
     36 +                    output = "Name: " + name + "\nRouter Model: " + router + "\nFirmware Version: " + version + "\nAutoupdater Status: " + autoupdate + "\nAutoupdater Branch: " + autoupdateBranch + "\nClients Connected: " + clients + "\nOnline Status: " + status + "\nFirst Seen: " + since
     37 +                  }
     38 +                  if(handler == "slack"){
     39 +                    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
     40                    }
     41                  }
     42                });