Skip to content

Instantly share code, notes, and snippets.

@seanlinehan
Created September 12, 2015 23:40
Show Gist options
  • Save seanlinehan/63eb36e622689b2457da to your computer and use it in GitHub Desktop.
Save seanlinehan/63eb36e622689b2457da to your computer and use it in GitHub Desktop.
#!/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