From your traceback, it seems to crash when trying to clean the JSON response.
clean_json_response() tries to split the response string at
])}while(1);</x>, but is not able to find it in the response. Hence, it can’t access element
 from the list.
One hypothesis is what you just said. Your Internet connection might have dropped for a second, resulting in an empty response. That response does not have the
])}while(1);</x> string to split at.
I will put an exception handling mechanism so that it skips the user/post/response if it gets a bad response.