Skip to content

Instantly share code, notes, and snippets.

@brandonweeks
Last active December 3, 2015 02:11
Show Gist options
  • Save brandonweeks/fff978489cd233aff442 to your computer and use it in GitHub Desktop.
Save brandonweeks/fff978489cd233aff442 to your computer and use it in GitHub Desktop.
url = '/users/%s/favorites' % client.get('/me').id
while url:
response = client.get(url, order='favorited_at', limit=PAGE_SIZE, linked_partitioning=True)
url = response.next_href if 'next_href' in response.keys() else None
db.tracks.insert_many([track.obj for track in response.collection])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment