You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Probably a json object that isn't a tweet (i.e., is a delete message or a limit message, etc.) and hence doesn't have a "user" object in it. This should be dug into further (e.g., if it's a delete message we should actually update the code to delete the corresponding tweet). As a quick fix, however, try changing
def parse(tweet):
tw=Tweet()
to
def parse(tweet):
if not "user" in tweet:
return
tw=Tweet()
which will just skip the lines that don't have a 'user' object in them.
Activity
computermacgyver commentedon May 26, 2015
Probably a json object that isn't a tweet (i.e., is a delete message or a limit message, etc.) and hence doesn't have a "user" object in it. This should be dug into further (e.g., if it's a delete message we should actually update the code to delete the corresponding tweet). As a quick fix, however, try changing
to
which will just skip the lines that don't have a 'user' object in them.