_FAIL_TEXT="An artist wants to write all the stories in the world. She meets a cartographer and an inventor. The inventor makes a machine to make old stories new. The new stories are stranger than the originals, but the machine needs an internet connection. This is a great pity and the reader is sad."
_LABEL=None
deffetch_story():
# use for testing when wifi fails
# return "A man falls in love with two twin sisters and is unable to decide which one to marry. Only the children survive. Through the window, the boy can see two big cranes in a construction site. But he loves her so much by now that he goes on with the marriage and then, he just waits."
# print( "fetch_story" )
story=None
withhttp.get(_STORY_URL)asresponse:
ifresponse.status!=200:
return_FAIL_TEXT
story=response.raise_for_status().json()
# {
# number: "61,957",
# story: "A man falls in love with two twin sisters and is unable to decide which one to marry. Only the children survive. Through the window, the boy can see two big cranes in a construction site. But he loves her so much by now that he goes on with the marriage and then, he just waits."