DmitrMakeev
commited on
Commit
•
ad918f5
1
Parent(s):
8578d73
Update app.py
Browse files
app.py
CHANGED
@@ -390,32 +390,7 @@ def add_data_ras():
|
|
390 |
|
391 |
|
392 |
|
393 |
-
@app.route('/biz_v', methods=['GET'])
|
394 |
-
def biz_v():
|
395 |
-
api_sys_control = request.args.get('api_sys')
|
396 |
-
if api_sys_control != api_key_sys:
|
397 |
-
return "EUR 22", 200
|
398 |
-
return render_template('biz_v.html')
|
399 |
|
400 |
-
@app.route('/send_request', methods=['POST'])
|
401 |
-
def send_request():
|
402 |
-
token = request.form.get('token')
|
403 |
-
url = 'https://online.bizon365.ru/api/v1/webinars/reports/getlist?maxDate=2021-08-06T00:00:00'
|
404 |
-
|
405 |
-
response = requests.get(url, headers={'X-Token': token})
|
406 |
-
|
407 |
-
if response.status_code == 200:
|
408 |
-
data = json.loads(response.text)
|
409 |
-
html_output = '<ul>'
|
410 |
-
for webinar in data['list']:
|
411 |
-
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>'
|
412 |
-
html_output += '</ul>'
|
413 |
-
return html_output
|
414 |
-
else:
|
415 |
-
return jsonify({'error': 'Failed to fetch data from the API'}), response.status_code
|
416 |
-
|
417 |
-
if __name__ == '__main__':
|
418 |
-
app.run(debug=True)
|
419 |
|
420 |
|
421 |
|
|
|
390 |
|
391 |
|
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
394 |
|
395 |
|
396 |
|