def add_zoom_links(): all_data = load_presentation_data().to_dict(orient="records") for data in all_data: print(data["unique_id"]) if INCLUDE_MEETING_URLS: meeting_id = "OOL_{}".format(data["unique_id"]) if meeting_json_exists(meeting_id): meeting = read_meeting_json(meeting_id) data["meeting_url"] = meeting["join_url"] else: print("No meeting '{}'".format(meeting_id)) data["meeting_url"] = "" else: data["meeting_url"] = "" path = "program/ool_{}.html".format(data["unique_id"]) with open(path, "r") as fh: html = fh.read() pattern = r"meeting_url: .*" repl = r"meeting_url: {}".format(data["meeting_url"]) html = re.sub(pattern, repl, html) with open(path, "w") as fh: fh.write(html)
def make_program(): # Delete existing files. files = os.listdir("program") for file in files: os.remove(os.path.join("program", file)) all_data = load_presentation_data().to_dict(orient="records") for data in all_data: print(data["unique_id"]) if INCLUDE_MEETING_URLS: meeting_id = "BAICS_{}".format(data["unique_id"]) if meeting_json_exists(meeting_id): meeting = read_meeting_json(meeting_id) data["meeting_url"] = meeting["join_url"] else: print("No meeting '{}'".format(meeting_id)) data["meeting_url"] = "" else: data["meeting_url"] = "" data["camera_ready"] = str(data["camera_ready"]).lower() data["title"] = data["title"].replace("\"", "\\\"") data["live"] = str(data["live"]).lower() data["rocket_id"] = "baics_channel_{:02d}".format(data["unique_id"]) if data["kind"] == "opening": data["rocket_id"] = "workshop_BAICS" html = TEMPLATE.format(**data) path = "program/baics_{}.html".format(data["unique_id"]) assert not os.path.exists(path) with open(path, "w") as fh: fh.write(html)
def get_users(): if meeting_json_exists("users"): return read_meeting_json("users") else: params = {"status": "active", "page_size": 30, "page_number": 1} users = _get("/users", params)["users"] save_meeting_json("users", users) return users
def get_zoom_users(): account_info = pd.read_csv("scripts/data/zoom_accounts.csv") users = pd.DataFrame(read_meeting_json("users")) users = pd.merge(users, account_info, on="email", how="inner") users = users.rename(columns={ "id": "host_id", "email": "host_email", "password": "******" }) users = users[["host_id", "host_email", "host_password", "host_key"]] return users
def get_zoom_meetings(ids, prefix): meetings = [] for unique_id in ids: if meeting_json_exists("{}_{}".format(prefix, unique_id)): meeting_info = read_meeting_json("{}_{}".format(prefix, unique_id)) meeting_info["unique_id"] = unique_id meetings.append(meeting_info) meetings = pd.DataFrame(meetings) meetings = meetings[[ "host_id", "start_url", "join_url", "unique_id", "password" ]] meetings = meetings.rename(columns={"password": "******"}) return meetings
def create_or_update_meeting( unique_id, user_email, topic, start_time, password, duration, waiting_room): if len(password) > 10: raise ValueError("password length must be <10") if meeting_json_exists(unique_id): meeting_id = read_meeting_json(unique_id)['id'] settings = { "topic": topic, "start_time": start_time, "password": password, "duration": duration, "settings": { "join_before_host": not waiting_room, "waiting_room": waiting_room } } _patch("/meetings/{}".format(meeting_id), json=settings) meeting = _get("/meetings/{}".format(meeting_id)) else: settings = { "topic": topic, "type": 2, # scheduled meeting "start_time": start_time, "duration": duration, "password": password, "settings": { "host_video": True, "participant_video": False, "join_before_host": not waiting_room, "mute_upon_entry": True, "watermark": False, "use_pmi": False, "approval_type": 2, "audio": "both", "auto_recording": "none", "waiting_room": waiting_room, "meeting_authentication": True, } } user = find_user(user_email) url = "/users/{}/meetings".format(user["id"]) meeting = _post(url, json=settings) save_meeting_json(unique_id, meeting) return meeting
def make_program(): # Delete existing files. files = os.listdir("program") for file in files: os.remove(os.path.join("program", file)) all_data = load_presentation_data().to_dict(orient="records") for data in all_data: print(data["unique_id"]) if INCLUDE_MEETING_URLS: meeting_id = "OOL_{}".format(data["unique_id"]) if meeting_json_exists(meeting_id): meeting = read_meeting_json(meeting_id) data["meeting_url"] = meeting["join_url"] else: print("No meeting '{}'".format(meeting_id)) data["meeting_url"] = "" else: data["meeting_url"] = "" data["camera_ready"] = str(data["camera_ready"]).lower() data["title"] = data["title"].replace("\"", "\\\"") data["abstract"] = data["abstract"] data["live"] = str(data["live"]).lower() data["rocket_id"] = "ool-paper-{:d}".format(data["unique_id"]) if data["kind"] == "opening": data[ "rocket_id"] = "object-oriented-learning-perception-representation-and-reasoning-11" html = TEMPLATE.format(**data) path = "program/ool_{}.html".format(data["unique_id"]) assert not os.path.exists(path) with open(path, "w") as fh: fh.write(html)