Add total posts to the hashtag_frequencies console printing

This commit is contained in:
X
2022-05-06 10:25:10 +02:00
parent f918f06c28
commit 52338d47de
2 changed files with 2 additions and 1 deletions

View File

@@ -118,7 +118,7 @@ def log_writer(log_data: list):
Writes the dictionary to the log file (logs/log.json).
"""
total = 0
scraped_summary_dict: dict
scraped_summary_dict: dict = {}
for hashtag, (data_type, count) in log_data:
if hashtag in scraped_summary_dict:
if data_type in scraped_summary_dict[hashtag]:

View File

@@ -92,6 +92,7 @@ def print_occurrences(occs):
ratio = value / total_posts
print("{:<8} {:<15} {:<15} {:<15}".format(row_number, key, value, ratio))
row_number += 1
print(f"Total posts: {total_posts}")
def save_plot(img_folder):