Skip to content

Instantly share code, notes, and snippets.

@pjaudiomv
Last active December 27, 2023 00:36
Show Gist options
  • Save pjaudiomv/6957fd9e92ab6de0409dec31ecdbc880 to your computer and use it in GitHub Desktop.
Save pjaudiomv/6957fd9e92ab6de0409dec31ecdbc880 to your computer and use it in GitHub Desktop.
BMLT Servers with Custom Field Keys
import urllib3
import json
standard_keys = ['id_bigint', 'worldid_mixed', 'service_body_bigint', 'weekday_tinyint', 'venue_type', 'start_time', 'duration_time', 'time_zone', 'formats', 'lang_enum', 'longitude', 'latitude', 'meeting_name', 'location_text', 'location_info', 'location_street', 'location_city_subsection', 'location_neighborhood', 'location_municipality', 'location_sub_province', 'location_province', 'location_postal_code_1', 'location_nation', 'comments', 'train_lines', 'bus_lines', 'phone_meeting_number', 'virtual_meeting_link', 'virtual_meeting_additional_info', 'root_server_uri', 'format_shared_id_list']
req = urllib3.PoolManager().request("GET", 'https://aggregator.bmltenabled.org/main_server/api/v1/rootservers')
root_servers = json.loads(req.data.decode())
root_servers = sorted(root_servers, key=lambda k: k['name'])
for root in root_servers:
root_info = json.loads(root['serverInfo'])
available_keys = root_info['available_keys'].split(',')
unique_keys = [key for key in available_keys if key not in standard_keys]
if len(unique_keys) >= 1:
print(f"\n{root['name']}")
print(unique_keys)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment