-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
41 lines (33 loc) · 824 Bytes
/
Copy path__init__.py
File metadata and controls
41 lines (33 loc) · 824 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
29
30
31
32
33
34
35
36
37
38
39
40
41
from flask import Flask
from aDay import ADay
from aMonth import AMonth
from aYear import AYear
from aRange import ARange
from aFeed import AFeed
app = Flask(__name__)
#2017-05-03
@app.route('/data/d')
def show_day_sentiment():
aDayObj = ADay()
return aDayObj.getSentiment()
#2017-05
@app.route('/data/m')
def show_month_sentiment():
aMonthObj = AMonth()
return aMonthObj.getSentiment()
#2017
@app.route('/data/y')
def show_year_sentiment():
aYearObj = AYear()
return aYearObj.getSentiment()
#2017-05-03,2017-06-01
@app.route('/data/r/<range>')
def show_range_sentiment(range):
aRangeObj = ARange(range)
return aRangeObj.getSentiment()
@app.route('/data/f')
def show_feed():
aFeedObj = AFeed()
return aFeedObj.getSentiment()
if __name__ == '__main__':
app.run(debug = True)