Bläddra i källkod

first_seen: try to include location of node in message (fetched from BATCAVE)

Helge Jung 9 år sedan
förälder
incheckning
b0bc5fd598
1 ändrade filer med 5 tillägg och 0 borttagningar
  1. 5 0
      modules/ffpb.py

+ 5 - 0
modules/ffpb.py

@@ -543,6 +543,11 @@ def ffpb_updatealfred(bot):
                     u'sieht die ersten Herzschläge von {0}',
                     u'stellt einen großen Pott Heißgetränk zu {0} und fragt ob es hier Meshpartner gibt.',
                 )).format('\'' + str(new[0][1]) + '\'')
+
+                # try to fetch location from BATCAVE in order to add a geomap URL
+                location = ffpb_get_batcave_nodefield(str.replace(new[0][0], ':', ''), 'location')
+                if not location is None:
+                    action_msg += ' http://map.paderborn.freifunk.net/geomap.html?lat=' + location['latitude'] + '&lon=' + location['longitude']
             else:
                 action_msg = random.choice((
                     'bemerkt die neuen Knoten {0} und {1}',