[](https://www.python.org/downloads/) [](https://github.com/deedy5/fake_traffic/releases) [](https://pypi.org/project/fake-traffic)
# fake_traffic
Imitating an Internet user by mimicking popular web traffic (internet traffic generator).
### How it works:
```python3
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
```python3
pip install -U fake_traffic
```
---
### Dependencies (are installed automatically)
```python3
lxml
requests
google_trends
duckduckgo_search
google_searching
```
---
### Simple usage
```python3
from fake_traffic import fake_traffic
fake_traffic(country='US', language='en-US")
```
---
### Advanced usage
```python3
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](https://www.iso.org/obp/ui/)):</br>
- country = "TR" </br>
Find Turkey country-language code ([ISO-639 and ISO-3166](https://www.fincher.org/Utilities/CountryLanguageList.shtml)): </br>
- english "en-TR", </br>
- kurdish "ku-TR", </br>
- turkish "tr-TR". </br>
Set the category ('h', because the user in the example is interested in hot stories):
- category = 'h'
Starting work in two threads:
- threads=2
```python3
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:
```python3
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") |
Raw data
{
"_id": null,
"home_page": "https://github.com/deedy5/fake_traffic",
"name": "fake-traffic",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": "",
"keywords": "",
"author": "deedy5",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/e8/95/08b415fb4f9e6058eb06710d0a42ae773b5c0ff89c1ae12f01d2cc18ac93/fake_traffic-1.8.1.tar.gz",
"platform": null,
"description": "[](https://www.python.org/downloads/) [](https://github.com/deedy5/fake_traffic/releases) [](https://pypi.org/project/fake-traffic) \n# fake_traffic\nImitating an Internet user by mimicking popular web traffic (internet traffic generator).\n\n### How it works:\n```python3\n1. you specify the country, language and category of interests of a user,\nwhile True:\n 2. from google trends the script gets a list of popular keywords that are searched in real time \n on google by people with a given category of interest in a given country in a given language,\n threads:\n 3. select a random trend, take from there the keywords and urls of related articles,\n 4. the selected keywords are searched on google and duckduckgo, the found urls are added \n to the existing ones,\n 5. the script sequentially sends requests to a list of urls,\n 6. in each open url, recursive queries to random links are performed to a random depth (1-5).\n```\n---\n### Install\n\n```python3\npip install -U fake_traffic\n```\n---\n### Dependencies (are installed automatically)\n```python3\nlxml\nrequests\ngoogle_trends\nduckduckgo_search\ngoogle_searching\n```\n---\n### Simple usage\n```python3\nfrom fake_traffic import fake_traffic\n\nfake_traffic(country='US', language='en-US\")\n```\n---\n### Advanced usage\n```python3\nfrom fake_traffic import fake_traffic\n\nfake_traffic(country='US', language='en-US', category='h', threads=2, min_wait=1, max_wait=5, debug=True)\n \"\"\" Imitating an Internet user by mimicking popular web traffic (internet traffic generator). \n country = country code ISO 3166-1 Alpha-2 code (https://www.iso.org/obp/ui/),\n language = country-language code ISO-639 and ISO-3166 (https://www.fincher.org/Utilities/CountryLanguageList.shtml),\n category = \u0441ategory of interest of a user (defaults to 'h'):\n 'all' (all), 'b' (business), 'e' (entertainment), \n 'm' (health), 's' (sports), 't' (sci/tech), 'h' (top stories);\n threads = number of threads (defaults to 2),\n min_wait = minimal delay between requests (defaults to 1),\n max_wait = maximum delay between requests (defaults to 60),\n debug = if True, then print the details of the requests (defaults to False).\n \"\"\"\n```\n---\n### Example\nMimic traffic of a user located in Turkey, who speaks Kurdish and is interested in hot stories\n\nFind Turkey country code ([ISO 3166-1 Alpha-2 code](https://www.iso.org/obp/ui/)):</br>\n - country = \"TR\" </br>\n\nFind Turkey country-language code ([ISO-639 and ISO-3166](https://www.fincher.org/Utilities/CountryLanguageList.shtml)): </br>\n - english \"en-TR\", </br>\n - kurdish \"ku-TR\", </br>\n - turkish \"tr-TR\". </br>\n\nSet the category ('h', because the user in the example is interested in hot stories):\n - category = 'h'\n\nStarting work in two threads:\n - threads=2\n```python3\nfrom fake_traffic import fake_traffic\n\nfake_traffic(country=\"TR\", language=\"ku-TR\", category='h', threads=2)\n```\nP.S. you can select language from other country. \nFor example, such combinations are also correct:\n```python3\nfake_traffic(country=\"TR\", language=\"ar-TR\")\nfake_traffic(country=\"US\", language=\"he-IL\")\nfake_traffic(country=\"DE\", language=\"hi-IN\")\n```\n---\n### Other examples\nCountry | Language | Function |\n----------|---------- | ---------------------------------------------|\nFrance | French | fake_traffic(country=\"FR\", language=\"fr-FR\") |\nGermany | German | fake_traffic(country=\"DE\", language=\"de-DE\", category='b') |\nIndia | English | fake_traffic(country=\"IN\", language=\"en-IN\", category='all') |\nIndia | Hindi | fake_traffic(country=\"IN\", language=\"hi-IN\", max_wait=10) |\nRussia | English | fake_traffic(country=\"RU\", language=\"en-US\", category='b', threads=3, debug=True) |\nRussia | Russian | fake_traffic(country=\"RU\", language=\"ru-RU\", min_wait=0.5, max_wait=3, threads=5) |\nBrazil | Portuguese | fake_traffic(country=\"BR\", language=\"pt-BR\", category='s', threads=2, max_wait=60, debug=True) |\nUnited Kingdom | English | fake_traffic(country=\"GB\", language=\"en-GB\") |\nUnited States | English | fake_traffic(country=\"US\", language=\"en-US\", min_wait=60, max_wait=300) |\nUnited States | Hebrew Israel | fake_traffic(country=\"US\", language=\"he-IL\") |\n\n\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Imitating an Internet user by mimicking popular web traffic",
"version": "1.8.1",
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"md5": "3fba67a1d5d7d8ae69ff10414df1003d",
"sha256": "cbf4ff6cbe158688517f7d90359690d61334107bb2e25a1a09eee0623bd1abf8"
},
"downloads": -1,
"filename": "fake_traffic-1.8.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "3fba67a1d5d7d8ae69ff10414df1003d",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6737,
"upload_time": "2022-03-24T04:13:16",
"upload_time_iso_8601": "2022-03-24T04:13:16.897881Z",
"url": "https://files.pythonhosted.org/packages/d4/07/94b8c59b1183cc678575083be82a2e5e956fc74973e233380feb2b45b92b/fake_traffic-1.8.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"md5": "5a12d011088930fb653f5a90e164f327",
"sha256": "179ded1b7a1b2018536f17013cd30f56f15d6214845b2d957adbc153270b92e5"
},
"downloads": -1,
"filename": "fake_traffic-1.8.1.tar.gz",
"has_sig": false,
"md5_digest": "5a12d011088930fb653f5a90e164f327",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 6280,
"upload_time": "2022-03-24T04:13:18",
"upload_time_iso_8601": "2022-03-24T04:13:18.001026Z",
"url": "https://files.pythonhosted.org/packages/e8/95/08b415fb4f9e6058eb06710d0a42ae773b5c0ff89c1ae12f01d2cc18ac93/fake_traffic-1.8.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2022-03-24 04:13:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "deedy5",
"github_project": "fake_traffic",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "fake-traffic"
}