From d1bccfd7a21705c7feab16382f98c952a5bd1b4a Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Thu, 24 Mar 2022 07:12:00 +0300 Subject: [PATCH] v1.8.1 shuffle trends --- fake_traffic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fake_traffic.py b/fake_traffic.py index e34a6a4..1164881 100644 --- a/fake_traffic.py +++ b/fake_traffic.py @@ -1,4 +1,4 @@ -from random import uniform, choice, randint, sample +from random import uniform, choice, randint, sample, shuffle from concurrent.futures import ThreadPoolExecutor from datetime import datetime, timedelta from time import sleep @@ -10,7 +10,7 @@ from google_searching import ggl from google_trends import daily_trends, realtime_trends -__version__ = '1.8' +__version__ = '1.8.1' THREADS = 2 MIN_WAIT = 1 @@ -197,6 +197,7 @@ def fake_traffic(country='US', language='en-US', category='h', threads=THREADS, print(f'---GET TRENDS IN {country=} {language=} {category=}---') trends = real_trends(country=country, language=language, category=category) #trends = sample(trends, threads) + shuffle(trends) for temp_trends in grouper(trends, threads): with ThreadPoolExecutor(threads) as executor: for i, trend in enumerate(temp_trends, start=1):