Update app.py
Browse files
app.py
CHANGED
|
@@ -625,10 +625,18 @@ def send_request():
|
|
| 625 |
response = requests.get(url, headers={'X-Token': token})
|
| 626 |
|
| 627 |
if response.status_code == 200:
|
| 628 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 629 |
else:
|
| 630 |
return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
|
| 631 |
|
|
|
|
|
|
|
|
|
|
| 632 |
|
| 633 |
|
| 634 |
|
|
|
|
| 625 |
response = requests.get(url, headers={'X-Token': token})
|
| 626 |
|
| 627 |
if response.status_code == 200:
|
| 628 |
+
data = json.loads(response.text)
|
| 629 |
+
html_output = '<ul>'
|
| 630 |
+
for webinar in data['list']:
|
| 631 |
+
html_output += f'<li>Name: {webinar["name"]}, Webinar ID: {webinar["webinarId"]}, Type: {webinar["type"]}, Created: {webinar["created"]}, Participants: {webinar["count1"]}, Duration: {webinar["count2"]} minutes</li>'
|
| 632 |
+
html_output += '</ul>'
|
| 633 |
+
return html_output
|
| 634 |
else:
|
| 635 |
return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
|
| 636 |
|
| 637 |
+
if __name__ == '__main__':
|
| 638 |
+
app.run(debug=True)
|
| 639 |
+
|
| 640 |
|
| 641 |
|
| 642 |
|