def tweets_js(request): keywords_pie_chart = analyzer.tweets_keywords_pie_chart() tweets_annotation_chart =analyzer.tweets_annotation_chart() context = {'keywords_pie_chart': keywords_pie_chart, 'referring_acounts':tweets_annotation_chart[0], 'tweet_by_date': tweets_annotation_chart[1]} return render(request, 'statistics/tweets_js.html', context)
def setTweetCachedData(): keywords_pie_chart = analyzer.tweets_keywords_pie_chart() tweets_annotation_chart = analyzer.tweets_annotation_chart() with open("Tweet_Statistics.Json", 'w') as outfile: context = {'keywords_pie_chart': keywords_pie_chart, 'referring_acounts':tweets_annotation_chart[0], 'tweet_by_date': tweets_annotation_chart[1]} json.dump(context, outfile)
def tweets(request): if not request.user.is_authenticated(): return redirect("/admin/login/?next=%s" % request.path) keywords_pie_chart = analyzer.tweets_keywords_pie_chart() tweets_annotation_chart = analyzer.tweets_annotation_chart() context = { "keywords_pie_chart": keywords_pie_chart, "monitoring_acounts": tweets_annotation_chart[0], "tweet_by_date": tweets_annotation_chart[1], } return render(request, "statistics/tweets.html", context)