Skip to content

Instantly share code, notes, and snippets.

@alxngyn
Last active June 11, 2018 17:49
Show Gist options
  • Save alxngyn/18856119041410e13489e7a5d2f8a2f2 to your computer and use it in GitHub Desktop.
Save alxngyn/18856119041410e13489e7a5d2f8a2f2 to your computer and use it in GitHub Desktop.
# importing the requests library
import requests
# defining the api-endpoint
API_ENDPOINT = "http://flappyblock.ml:3020/chats"
def lol_linus(message):
chatMessage = {
"name": "testbot",
"chat": message
}
# sending post request and saving response as response object
r = requests.post(url = API_ENDPOINT, data = chatMessage)
# extracting response text
response = r.text
print("The response is:%s"%response)
for i in range(10000):
mymessage = "Hi Linux #" + str(i)
lol_linus(mymessage)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment