Skip to content

Commit

Permalink
Update fake_traffic.py
Browse files Browse the repository at this point in the history
added lines of documentation to the function 'fake_traffic'
  • Loading branch information
deedy5 authored Aug 20, 2021
1 parent 114be92 commit 7995a9d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions fake_traffic.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7995a9d

Please sign in to comment.