diff --git a/conf.yml b/conf.yml new file mode 100644 index 0000000..beb9b07 --- /dev/null +++ b/conf.yml @@ -0,0 +1,127 @@ +led0: + - https://www.devtal.de/api/ +led1: + - https://www.binary-kitchen.de/spaceapi.php +led2: + - https://status.aachen.ccc.de/spaceapi +led3: + - https://schalter.ccchb.de/spaceapi.json +led4: + - https://api.koeln.ccc.de +led5: + - https://www.ccc-mannheim.de/spaceapi/spaceapi.json +led6: + - http://cccfr.de/status/spaceapi.py +led7: + - http://chaos-consulting.de/api/space.api +led8: + - https://status.chaospott.de/status.json +led9: + - https://chaoschemnitz.de/chch.json +led10: + - https://www.ccc-p.org/spaceapi.json +led11: + - http://doorstatus.c3re.de/status/json +led12: + - http://status.ctdo.de/api/spaceapi/v13 +led13: + - https://status.diyww.de/status.json +led14: + - http://club.entropia.de/spaceapi +led15: + - https://fablab.fau.de/spaceapi/ +led16: + - https://spaceapi.futev.de/spaceapi.json +led17: + - https://freieslabor.org/api/info +led18: + - https://hackerspace-bielefeld.de/spacestatus/status.json +led19: + - https://hacklabor.de/api/space/v1/ +led20: + - http://spaceapi.hacksaar.de/status.json +led21: + - https://status.hasi.it/spaceapi +led22: + - https://status.kraut.space/api +led23: + - http://status.leinelab.org/api/spaceapi.json +led24: + - http://status.mainframe.io/api/spaceInfo +led25: + - http://spaceapi.n39.eu/json +led26: + - http://netzladen.org/api/status.json +led27: + - https://api.nerd2nerd.org/status.json +led28: + - https://cccgoe.de/spaceapi.php +led29: + - http://api.openlab-augsburg.de/data.json +led30: + - https://werkraum.freiraumzittau.de/spaceapi/13/ +led31: + - https://spaceapi.reaktor23.org +led32: + - http://status.stratum0.org/status.json +led33: + - https://api.warpzone.ms/spaceapi +led34: + - https://hsmr.cc/spaceapi.json +led35: + - https://status.bckspc.de/spacestatus.php +led36: + - http://stats.bytewerk.org/status.json +led37: + - https://api.flipdot.org/ +led38: + - https://spaceapi.hackzogtum-coburg.de +led39: + - https://state.maglab.space/spaceapi.json +led40: + - http://nobreakspace.org/status/spaceapi.json +led41: + - https://bodensee.space/spaceapi/see-base.json +led42: + - https://api.shackspace.de/v1/spaceapi +led43: + - https://verschwoerhaus.de/feed/spaceapi +led44: + - https://vspace.one/spaceapi.json +led45: + - https://keinanschluss.un-hack-bar.de/spaceapi.json +led46: + - https://www.hackerspace-sw.de/spaceapi.json +led47: + - https://hamburg.ccc.de/dooris/status.json + - http://blog.attraktor.org/spaceapi/spaceapi.json +led48: + - https://status.makerspace-erfurt.de/status.json + - http://status.bytespeicher.org/status.json +led49: + - http://status.munichmakerlab.de/spaceapi.php + - http://api.muc.ccc.de/spaceapi.json +led50: + - http://api.terminal21.de + - http://api.terminal21.de/status_ebk.json +led51: + - https://fnord.istsystemrelevant.de/spaceapi.json + - https://chaosdorf.de/space_api.json +led52: + - http://spaceapi.nordlab-ev.de + - https://api.chaostreff-flensburg.de/ +led53: + - http://www.space-left.org/spaceapi13.json + - https://das-labor.org/status/api +led54: + - http://www.turmlabor.de/spaces.api + - https://www.c3d2.de/spaceapi.json +led55: + - http://spaceapi.k4cg.org/spaceapi.json + - http://api.fablab-nuernberg.de/spaceapi.php + - https://status.nerdberg.de/api/space +led56: + - https://x-hain.de/spaceapi-0.13.json + - http://www.c-base.org/status.json + - https://spaceapi.motionlab.berlin/ + - https://spaceapi.afra-berlin.de/v1/status.json diff --git a/dots.svg b/dots.svg new file mode 100644 index 0000000..c2234f5 --- /dev/null +++ b/dots.svg @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/get_coordinates.py b/get_coordinates.py index 4937c35..f6ad4d0 100755 --- a/get_coordinates.py +++ b/get_coordinates.py @@ -43,6 +43,10 @@ def merge(n1, n2): returner = [] returner.append(lat) returner.append(lon) + for i in range(2, len(n1)): + returner.append(n1[i]) + for i in range(2, len(n2)): + returner.append(n2[i]) return returner @@ -50,7 +54,7 @@ def get_space_location(space): try: spacerequest = requests.get(url=data[space], timeout=1) spacedata = spacerequest.json() - except requests.exceptions.RequestException as _: # This is the correct syntax + except requests.exceptions.RequestException as _: return except json.JSONDecodeError as _: return @@ -58,7 +62,7 @@ def get_space_location(space): if "lat" in spacedata["location"]: lat = spacedata["location"]["lat"] lon = spacedata["location"]["lon"] - return [float(lat), float(lon)] + return [float(lat), float(lon), data[space]] if os.path.isfile('locations.bin'): @@ -66,7 +70,7 @@ if os.path.isfile('locations.bin'): with open("locations.bin", "rb") as f: locations = pickle.load(f) else: - print("offline data not available, downloading...,", file=sys.stderr) + print("offline data not available, downloading...", file=sys.stderr) r = requests.get(url=URL) data = r.json() with concurrent.futures.ThreadPoolExecutor(max_workers=16) as executor: @@ -114,11 +118,10 @@ while german_locations: {"MERGED: " + n1 + " " + conflictnode: mergenode}) for space in finallist: - #print(space + " " + str(finallist[space][0]) + " " + str(finallist[space][1])) print(str(finallist[space][0]) + " " + str(finallist[space][1]) + " {" + space + "}") -dwg = svgwrite.Drawing('svgwrite-example.svg', profile='tiny') +dwg = svgwrite.Drawing('dots.svg', profile='tiny') dwg.add(svgwrite.image.Image(href="Karte_Deutschland.svg", size=(586, 793))) for space in finallist: ypoint = (793 - (((finallist[space][0] - SOUTHERNMOST) / YSPAN) * 793)) @@ -126,3 +129,13 @@ for space in finallist: dwg.add(dwg.circle(center=(xpoint, ypoint), r=5, fill='green')) dwg.save() + + +ledconf = open("conf.yml", "w") +i = 0 + +for space in finallist: + ledconf.write("led" + str(i) + ":\n") + for u in range(2, len(finallist[space])): + ledconf.write(" - " + finallist[space][u] + "\n") + i = i + 1 diff --git a/locations.bin b/locations.bin index 4218bdc..db8ec0b 100644 Binary files a/locations.bin and b/locations.bin differ