def ngrok_url():
try:<EOL><INDENT>ngrok_resp = requests.get("<STR_LIT>")<EOL><DEDENT>except requests.ConnectionError:<EOL><INDENT>return None<EOL><DEDENT>ngrok_data = ngrok_resp.json()<EOL>secure_urls = [<EOL>tunnel["<STR_LIT>"]<EOL>for tunnel in ngrok_data["<STR_LIT>"]<EOL>if tunnel["<STR_LIT>"] == "<STR_LIT>"<EOL>]<EOL>return secure_urls[<NUM_LIT:0>]<EOL>
If ngrok is running, it exposes an API on port 4040. We can use that
to figure out what URL it has assigned, and suggest that to the user.
https://ngrok.com/docs#list-tunnels