Skip to main content

Imitating an Internet user by mimicking popular web traffic

Project description

Python >= 3.6

fake_traffic

Imitating an Internet user by mimicking popular web traffic (internet traffic generator).

How it works:

1. you specify the country, language and category of interests of a user,
while True:
  2. from google trends the script gets a list of popular keywords that are searched in real time 
  on google by people with a given category of interest in a given country in a given language,
  threads:
    3. select a random trend, take from there the keywords and urls of related articles,
    4. the selected keywords are searched on google and duckduckgo, the found urls are added 
       to the existing ones,
    5. the script sequentially sends requests to a list of urls,
    6. in each open url, recursive queries to random links are performed to a random depth (1-5).

Install

pip install -U fake_traffic

Dependencies (are installed automatically)

lxml
requests
google_trends
duckduckgo_search
google_searching

Simple usage

from fake_traffic import fake_traffic

fake_traffic(country='US', language='en-US")

Advanced usage

from fake_traffic import fake_traffic

fake_traffic(country='US', language='en-US', category='h', threads=2, min_wait=1, max_wait=5, debug=True)
    """ 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),
    category = сategory of interest of a user (defaults to 'h'):
               'all' (all), 'b' (business), 'e' (entertainment), 
               'm' (health), 's' (sports), 't' (sci/tech), 'h' (top stories);
    threads = number of threads (defaults to 2),
    min_wait = minimal delay between requests (defaults to 1),
    max_wait = maximum delay between requests (defaults to 60),
    debug = if True, then print the details of the requests (defaults to False).
    """

Example

Mimic traffic of a user located in Turkey, who speaks Kurdish and is interested in hot stories

Find Turkey country code (ISO 3166-1 Alpha-2 code):

  • country = "TR"

Find Turkey country-language code (ISO-639 and ISO-3166):

  • english "en-TR",
  • kurdish "ku-TR",
  • turkish "tr-TR".

Set the category ('h', because the user in the example is interested in hot stories):

  • category = 'h'

Starting work in two threads:

  • threads=2
from fake_traffic import fake_traffic

fake_traffic(country="TR", language="ku-TR", category='h', threads=2)

P.S. you can select language from other country. For example, such combinations are also correct:

fake_traffic(country="TR", language="ar-TR")
fake_traffic(country="US", language="he-IL")
fake_traffic(country="DE", language="hi-IN")

Other examples

Country Language Function
France French fake_traffic(country="FR", language="fr-FR")
Germany German fake_traffic(country="DE", language="de-DE", category='b')
India English fake_traffic(country="IN", language="en-IN", category='all')
India Hindi fake_traffic(country="IN", language="hi-IN", max_wait=10)
Russia English fake_traffic(country="RU", language="en-US", category='b', threads=3, debug=True)
Russia Russian fake_traffic(country="RU", language="ru-RU", min_wait=0.5, max_wait=3, threads=5)
Brazil Portuguese fake_traffic(country="BR", language="pt-BR", category='s', threads=2, max_wait=60, debug=True)
United Kingdom English fake_traffic(country="GB", language="en-GB")
United States English fake_traffic(country="US", language="en-US", min_wait=60, max_wait=300)
United States Hebrew Israel fake_traffic(country="US", language="he-IL")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fake_traffic-1.8.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

fake_traffic-1.8-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file fake_traffic-1.8.tar.gz.

File metadata

  • Download URL: fake_traffic-1.8.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for fake_traffic-1.8.tar.gz
Algorithm Hash digest
SHA256 035748f5b108ad70c38338ef356f878bc5a4ed9c70e78ed7f28049d42cbad6d4
MD5 64e3c06228c6a18b744381d8cd697669
BLAKE2b-256 5969f0e987f0edd46e25b15a01716440c1bb46565e14ac6cbf6085c1aea23996

See more details on using hashes here.

File details

Details for the file fake_traffic-1.8-py3-none-any.whl.

File metadata

  • Download URL: fake_traffic-1.8-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for fake_traffic-1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 51c991e062d5b8c2ef7dc2f339432339f0a7055d182cb065c34cf8761ea0f5c4
MD5 fca99ecd1c15747d92803863c46896df
BLAKE2b-256 0f86115fbae4b5871522b4f3ada23cc5b43d1dfbc0047fe96504a4832a0c2848

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page