def global_results(request): configuration = Configuration() client = configuration.get_client() database_name = configuration.get_database_name() dao_global_results = GlobalResults(client, database_name) global_result = dao_global_results.get_global_results() return render(request, 'globalResults.html', {'global': global_result})
def get_last_tweet(request): configuration = Configuration() client = configuration.get_client() database_name = configuration.get_database_name() dao_last_tweet = LastTweet(client, database_name) tweet = dao_last_tweet.get_last_tweet()["tweet"] request.last_tweet = tweet return render(request, 'last_tweet.html', {"last_tweet": tweet['tweet']['text']})
def list_twitter_users(request, limitnumber=0, maxnumber=150): configuration = Configuration() client = configuration.get_client() database_name = configuration.get_database_name() dao_global_results = User(client, database_name) limitnumber = int(limitnumber) maxnumber = int(maxnumber) data = client.SilverEye.twitterUser.find()[limitnumber:maxnumber] return render(request, 'listUsersTwitter.html', {'users': data})
def get_dao_tags_collections(): configuration = Configuration() client = configuration.get_client() database_name = configuration.get_database_name() return DAOTags(client, database_name)