Skip to content

Conversation

markpasc
Copy link

@markpasc markpasc commented Mar 9, 2012

Hi! I tried to use the load_authors.py script for the first time and got this error:

Traceback (most recent call last):
  File "load_tweets.py", line 180, in <module>
    l = loadTweets(debug=True)
  File "load_tweets.py", line 39, in __init__
    self.fetchTweets(last_tweet_id)
  File "load_tweets.py", line 111, in fetchTweets
    self.update_authors(authors)
  File "load_tweets.py", line 132, in update_authors
    user['klout_score'] = response['users'][0]['kscore']
KeyError: 'users'

The response that caused the error is:

{
    "status": 200,
    "headers": [],
    "body": {
        "error": "No users"
    }
}

This seems to occur for some Twitter users, I assume because they aren't in Klout's system at all and don't have Klout scores. I was able to get this response repeatably in the interactive docs for my test Twitter account “mrakpsac”.

The attached patch cleared up the error for me by skipping these authors without trying to save a Klout score for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant