Created
September 12, 2015 23:40
-
-
Save seanlinehan/63eb36e622689b2457da to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import json | |
blob = "[Nuzzel JSON Blob]" | |
obj = json.loads(blob) | |
twitter_user_ids = [] | |
# Thanks for calling all these awesome people friends, Nuzzel | |
for friend in obj['results']['friends']: | |
# In theory, each Nuzzel user can have multiple accounts linked | |
# In practice, none of my friends had more than one | |
for account in friend['external_users']: | |
# Just in case. All of my results were Twitter here though | |
if account['typeName'] == 'Twitter': | |
# There's their Twitter ID! | |
twitter_user_ids.append(account['externalUserid']) | |
print twitter_user_ids |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment