Skip to content

Commit

Permalink
v1.8.1
Browse files Browse the repository at this point in the history
shuffle trends
  • Loading branch information
deedy5 authored Mar 24, 2022
1 parent 62fa683 commit d1bccfd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fake_traffic.py
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit d1bccfd

Please sign in to comment.