hello, excuse me for my bad english, I will use google translator to help me write in English, I'm developing a bot for telegram and I'm hosting it on pythonanywere, I found an funny url/json api and I wanted to implement it but it doesn't work, it doesn't work on pythonanywere with the code I'm writing, on python idle it worked
code that works:
import urllib
#'http://api.icndb.com/jokes/random'
import urllib.request
import json
def GetICNDBjoke():
req = urllib.request.Request('http://api.icndb.com/jokes/random')
r = urllib.request.urlopen(req).read()
js=json.loads(r)
joke=js['value']['joke']
return joke
print(GetICNDBjoke())
input('Press any key to continue...')
code that doesn't work: (the code is reduced and I removed what was not needed for example the other bot commands and my bot token for security reason) https://www.pythonanywhere.com/user/gabrielesilinic/shares/4674de475e54441e90ee14a7b54391f7/