forked from tinytinydev/HappyToiletSocialAnalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.py
21 lines (17 loc) · 735 Bytes
/
home.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from flask import Blueprint, render_template
import map
import json
import socialmedia
home = Blueprint('home', __name__)
@home.route("/index")
@home.route("/")
def index():
csv_file = open('docs/toilet_Reddit_sentiments_3.csv')
response = map.get_coords_with_location_reddit(csv_file)
#Social media counts
reddit_count = json.loads(socialmedia.reddit_count())["count"]
instareview_count = json.loads(socialmedia.instareview_count())["count"]
insta_response = socialmedia.crawl_toilet_sg()
print("INSTA RESULTS")
print(insta_response)
return render_template('index.html',title='Home',jsonResponse=response,reddit_count=reddit_count,instareview_count=instareview_count,insta_crawl=insta_response)