forked from AnkaiJie/AfdWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
executable file
·28 lines (23 loc) · 809 Bytes
/
app.py
File metadata and controls
executable file
·28 lines (23 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from flask import Flask, request, render_template
from celery import Celery
from config import APP_NAME
from tasks import run_overcite_script
from datapython.apilib import ScopusApiLib
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/request/overcitesAuthor', methods=['POST'])
def send_overcites():
form = request.form
runner = ScopusApiLib()
# print(form['author_id'])
try:
runner.getAuthorMetrics(form['author_id'])
run_overcite_script.delay(form['author_id'], form['paper_num'],
form['cite_num'], form['name'], form['email'])
return render_template('finish.html')
except KeyError as e:
return render_template('error.html')
if __name__ == '__main__':
app.run(debug=True)