Where to find the script of chaotic sending of requests?

Hello, once seen on github repository with a simple python script that randomly sends requests to sites from the list, which is stored in JSON format. Now can't find, maybe someone knows him or something poogie?
March 19th 20 at 08:49
1 answer
March 19th 20 at 08:51
Solution
I mean something like this:
import requests
import json
import time
foo = json.dumps("file.json").get("crazy list")
while true:
requests.get(random.choice(foo))
 time.sleep(10)


file.json
{ "crazy list": ["url","url","url","url","url","url","url"]
}
Maybe, just
Traceback (most recent call last):
 File "rq.py", line 4, in <module>
 foo = json.dumps("file.json").get("crazy list")
AttributeError: 'str' object has no attribute 'get'
- Garfield_Hartmann commented on March 19th 20 at 08:54
@Garfield_Hartmann, Heh my mistake for parsing need loads ))
foo = json.loads("file.json").get("crazy list") - Edna42 commented on March 19th 20 at 08:57
@Edna42, and still something is wrong, can not understand that, in python, do not fumble
import requests
import json
import time
foo = json.loads("./list.json").get("list")
while true:
requests.get(random.choice(foo))
 time.sleep(10)

list.json
{
 "list": [
"https://google.com",
"https://vk.com",
"https://twitter.com",
"https://fb.me"
]
}

Run, get
Traceback (most recent call last):
 File "rq.py", line 4, in <module>
 foo = json.loads("./list.json").get("list")
 File "/usr/lib/python3.7/json/__init__.py", line 348, in loads
 return _default_decoder.decode(s)
 File "/usr/lib/python3.7/json/decoder.py", line 337, in decode
 obj, end = self.raw_decode(s, idx=_w(s, 0).end())
 File "/usr/lib/python3.7/json/decoder.py", line 355, in raw_decode
 raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
- Garfield_Hartmann commented on March 19th 20 at 09:00
@Garfield_Hartmann, With these ready-made packages for every taste, even the standard library forget.))
import requests
import json
import time
import random
url_path = "json.json"
with open(url_path) as json_file:
 foo = json.load(json_file).get("list")
 while True:
print(requests.get(random.choice(foo)))
 time.sleep(10)

Want to ban the computer for all social networks?) time.sleep can remove then._) - Edna42 commented on March 19th 20 at 09:03
@Edna42, Yes, thank you, however, already managed by spear and attempts to understand everything without reading addicts to fix this, rewrite it using ping and find what I was looking for initially. this thing is called noisy - Garfield_Hartmann commented on March 19th 20 at 09:06

Find more questions by tags Python