Thanks for responding.
Mike Meyer

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 [1] 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.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.