From 0ae7f7c6da901ddb91b135ce168e8d7af9449e5b Mon Sep 17 00:00:00 2001 From: "g.minoccari" Date: Fri, 28 May 2021 12:51:54 +0200 Subject: [PATCH] Modificato l'import della funzione per autenticarsi --- nest_crawler/repo_search.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nest_crawler/repo_search.py b/nest_crawler/repo_search.py index 107c70e..5b94350 100644 --- a/nest_crawler/repo_search.py +++ b/nest_crawler/repo_search.py @@ -1,18 +1,22 @@ from nest_backend.database import * -from .authentication import authenticate +import authentication from datetime import datetime, timedelta import tweepy as tw from associate_condition_tweet import associate_condition_tweet def search_repo_conditions(repository_id): - api = authenticate() + + api = authentication.authenticate() repo = Repository.query.filter_by(id=repository_id).first() + if repo is None: print("Non esiste una repository con questo id") return False conditions = [use for use in repo.conditions] if len(conditions) == 0: return False + + print(f"Searching tweets from repo: {repo.name}") evaluation_mode = repo.evaluation_mode conditions_type = dict() @@ -136,3 +140,4 @@ def search_repo_conditions(repository_id): composed = Composed(rid=repository_id, snowflake=tweet.id) ext.session.add(composed) ext.session.commit() + print(f"Done searching tweets from repo: {repo.name}")