From 7995a9d30bcbea57dacdbb2c551427347302d5ee Mon Sep 17 00:00:00 2001 From: deedy5 <65482418+deedy5@users.noreply.github.com> Date: Fri, 20 Aug 2021 13:02:12 +0300 Subject: [PATCH] Update fake_traffic.py added lines of documentation to the function 'fake_traffic' --- fake_traffic.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/fake_traffic.py b/fake_traffic.py index ab79d6d..c089b3b 100644 --- a/fake_traffic.py +++ b/fake_traffic.py @@ -116,6 +116,16 @@ def _thread(trend): recursive_browse(url, depth=randint(max(0, 9-i), max(5, 11-i))) def fake_traffic(country='US', language='en-US', threads=THREADS, min_wait=MIN_WAIT, max_wait=MAX_WAIT, debug=DEBUG): +""" Imitating an Internet user by mimicking popular web traffic (internet traffic generator). + + country = country code ISO 3166-1 Alpha-2 code (https://www.iso.org/obp/ui/), + language = country-language code ISO-639 and ISO-3166 (https://www.fincher.org/Utilities/CountryLanguageList.shtml), + threads = number of threads (defaults to 1), + min_wait = minimal delay between requests (defaults to 1), + max_wait = maximum delay between requests (defaults to 30), + debug = if True, then print the details of the requests (defaults to False). + """ + global THREADS, MIN_WAIT, MAX_WAIT, DEBUG THREADS = threads MIN_WAIT = min_wait