Internet traffic generator.
Project description
fake_traffic
Internet traffic generator. Utilizes real-time google search trends by specified parameters.
Install
pip install -U fake_traffic
Install chromium browser with dependencies
playwright install --with-deps chromium
CLI version
fake_traffic -h
CLI examples:
# user located in Austria, who speaks German, using comma separated keywords.
fake_traffic -c at -l de-at -k "Olympiade, Medaille, Beste Leistung"
# user located in Turkey, who speaks Kurdish, using google trends.
fake_traffic -c tr -l ku-tr
# save logs into 'fake_traffic.log'
fake_traffic -c ru -l ru-ru -lf
# use none-headless mode
fake_traffic -c en -l en-us -nh
# limit the number of tabs in the browser to 2
fake_traffic -c en -l en-us -t 2
Simple usage
from fake_traffic import FakeTraffic
FakeTraffic(country="US", language="en-US").crawl()
Advanced usage
from fake_traffic import FakeTraffic
ft = FakeTraffic(country="US", language="en-US", category="h", headless=True)
"""Internet traffic generator. Utilizes real-time google search trends by specified parameters.
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),
keywords = comma separated queries for Google searches, if not specified, Google trending is used,
headless = True/False (defaults to True);
tabs = limit the number of tabs in browser (defaults to 3).
"""
ft.crawl()
Example
Using realtime search trends of a user located in Turkey, who speaks Kurdish
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".
Starting in none-headless mode:
- headless=False
from fake_traffic import FakeTraffic
ft = FakeTraffic(country="TR", language="ku-TR", keywords=None, headless=False)
ft.crawl()
P.S. you can select language from other country. For example, such combinations are also correct:
FakeTraffic(country="TR", language="ar-TR").crawl()
FakeTraffic(country="US", language="he-IL").crawl()
FakeTraffic(country="DE", language="hi-IN").crawl()
Other examples
Country | Language | Function |
---|---|---|
France | French | FakeTraffic(country="FR", language="fr-FR") |
Germany | German | FakeTraffic(country="DE", language="de-DE", keywords="Audi") |
India | English | FakeTraffic(country="IN", language="en-IN") |
India | Hindi | FakeTraffic(country="IN", language="hi-IN") |
Russia | English | FakeTraffic(country="RU", language="en-US", headless=False) |
Russia | Russian | FakeTraffic(country="RU", language="ru-RU") |
Brazil | Portuguese | FakeTraffic(country="BR", language="pt-BR") |
United Kingdom | English | FakeTraffic(country="GB", language="en-GB") |
United States | English | FakeTraffic(country="US", language="en-US", tabs=4) |
United States | Hebrew Israel | FakeTraffic(country="US", language="he-IL") |
Project details
Release history Release notifications | RSS feed
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-3.1.tar.gz
(5.6 kB
view details)
Built Distribution
File details
Details for the file fake_traffic-3.1.tar.gz
.
File metadata
- Download URL: fake_traffic-3.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac996789ae9d8d4e95c7951d35901f831931ade9861d4cd278509b80a5a43bd0 |
|
MD5 | 3803a98b1ffd7cfee9ab798a95766a29 |
|
BLAKE2b-256 | 0759a1d3274736861cb22526dbdddd304f36af8b00211badca05a95189d9eee4 |
File details
Details for the file fake_traffic-3.1-py3-none-any.whl
.
File metadata
- Download URL: fake_traffic-3.1-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | da8b68e18bb1aab5e42e91661ad7241bd5e96b25781bebe997b9482bda11b017 |
|
MD5 | dd24a9b06d0f7854eb8dc8cdd5941a2f |
|
BLAKE2b-256 | 2b3dc35f9907cd54a4b60b562deb02885bc94cc182e034f6d498cd1c95866b8f |