Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Graz to census #27

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions census-exporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def parse_meshviewer(data):
for node in data["nodes"]:
try:
node_id = node["node_id"]
if not node_id:
continue
if node_id in seen:
duplicates += 1
continue
Expand All @@ -86,6 +88,8 @@ def parse_nodes_json_v1(data, *kwargs):
global seen, duplicates
bases = defaultdict(int)
for node_id, node in data["nodes"].items():
if not node_id:
continue
if node_id in seen:
duplicates += 1
continue
Expand All @@ -107,6 +111,8 @@ def parse_nodes_json_v2(data, *kwargs):
for node in data["nodes"]:
try:
node_id = node["nodeinfo"]["node_id"]
if not node_id:
continue
if node_id in seen:
duplicates += 1
continue
Expand Down Expand Up @@ -164,6 +170,9 @@ def load(url):
return format["parser"](data)
except (Invalid, MultipleInvalid) as ex:
pass
except BaseException as ex:
log.msg("Exception caught while processing data", ex=ex)
raise ex

raise ValueError("No parser found")

Expand Down
3 changes: 3 additions & 0 deletions communities.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@
"Göttingen": [
"https://map.cccgoe.de/data/meshviewer.json"
],
"Graz": [
"https://hopglass.ffgraz.net/data/nodes.json"
],
"Greifswald": [
"https://map.ffhgw.de/data/meshviewer.json",
"https://unifi.greifswald.freifunk.net/data/meshviewer.json"
Expand Down