Skip to content

Instantly share code, notes, and snippets.

@sovietspy2
Created August 18, 2018 13:21
Show Gist options
  • Save sovietspy2/d39f2df275a6c8eabe106a7f0e8cf0e0 to your computer and use it in GitHub Desktop.
Save sovietspy2/d39f2df275a6c8eabe106a7f0e8cf0e0 to your computer and use it in GitHub Desktop.
Python3 chuck norris joke api (simple)
import requests
url = "http://api.icndb.com/jokes/random"
def get_chuck_norris_joke():
response = requests.get(url)
joke = dict(response.json())
return joke['value']['joke']
text = get_chuck_norris_joke()
print(text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment