DmitrMakeev commited on
Commit
9de9c09
·
verified ·
1 Parent(s): 7406429

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -1
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
- return jsonify(response.text)
 
 
 
 
 
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