now with less derp
This commit is contained in:
		
							parent
							
								
									14dc277816
								
							
						
					
					
						commit
						3082f36026
					
				| 
						 | 
					@ -9,7 +9,7 @@ def get_jitsi_status():
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        content = urllib.request.urlopen("https://talk.chaoswest.tv/room-census").read()
 | 
					        content = urllib.request.urlopen("https://talk.chaoswest.tv/room-census").read()
 | 
				
			||||||
        census = json.loads(content)
 | 
					        census = json.loads(content)
 | 
				
			||||||
        return any(room["room_name"] == "cws-lounge@muc.meet.jitsi" for room in census["room_census"])
 | 
					        return any(room["room_name"] == "cws-lounge@muc.meet.jitsi" for room in census.get("room_census", []))
 | 
				
			||||||
    except Exception as e:
 | 
					    except Exception as e:
 | 
				
			||||||
        print("shit got fucked up:")
 | 
					        print("shit got fucked up:")
 | 
				
			||||||
        print(e)
 | 
					        print(e)
 | 
				
			||||||
| 
						 | 
					@ -35,7 +35,7 @@ def spaceapi():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    status = get_jitsi_status()
 | 
					    status = get_jitsi_status()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if status:
 | 
					    if status is not None:
 | 
				
			||||||
        result["state"] = {
 | 
					        result["state"] = {
 | 
				
			||||||
            'open': status
 | 
					            'open': status
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue