Skip to content

Commit da17da4

Browse files
Removing unnecessary time sleep to prevent heroku timeout (#11)
* Feature/tweet acquisition (#1) * API initial config * Tweet acquisition API tracking and writing csv file correctly. TODO: Set stop-point to tweet streaming * Timezone convertion WIP * Added limit to stop streaming tweets. * Tweet acquisition done Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br> * Sentimental analysis (#2) * Saved best model * Preprocessing * Applying model to live search data. Return positive/negative ratio. Throw exception when no data is found. * LIME Text explainer * Mongodb connection * Sending tweets to crowdsourcing database Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br> * Trending topics API (#3) Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br> * Procfile (#4) Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br> * Fixing cors * Hotfix/async functions (#6) * Async functions to prevent 404 error * Fixing file reading error * Removed csv writer methods. Everything is being done on MongoDB cloud. Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br> * Hotfix - Trending topics * Fixing cors (#7) Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br> Co-authored-by: Fabiana Garcia <fabiana.garcia@fit-tecnologia.org.br>
1 parent 1b40c9d commit da17da4

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

api_routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,4 @@ def get(self):
4343
try:
4444
return SearchResultParser().trending_topics_parser(23424768), 200
4545
except:
46-
return 'INTERNAL SERVER ERROR', 500
46+
return 'INTERNAL SERVER ERROR', 500

repositories/twitter/tweet_acquisition_repository.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def stream_tweets(self, keyword):
1515
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET)
1616
stream = Stream(auth, stream_listener)
1717
stream.filter(track=[keyword], languages=["pt"], is_async=True)
18-
time.sleep(15)
18+
time.sleep(10)
1919
stream.disconnect()
2020

2121
def get_trending_topics(self, woeid):

services/search_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class SearchService():
1111

1212
def search(self, keyword):
1313
tweet_acquisition_repository.stream_tweets(keyword)
14-
time.sleep(5)
1514
try:
1615
df = MongoDbRepository().read_mongo_into_dataframe(keyword)
1716
MongoDbRepository().crowdsourcing_mongo_import(df)

0 commit comments

Comments
 (0)