Last active
December 21, 2015 19:49
-
-
Save soobrosa/6356520 to your computer and use it in GitHub Desktop.
if you ever happen to export your miso history in python
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
# to export your miso history | |
# register an app at http://gomiso.com/oauth_clients | |
# gain your consumer_key and consumer_secret | |
# grab Gomiso Python from https://github.com/metabaron/Gomiso-Python | |
# and your ready to go | |
# | |
# cc 2013 soobrosa | |
from gomiso import gomiso | |
import json | |
consumer_key = '' # insert your one here | |
consumer_secret = '' # insert your one here | |
username = '' # insert your one here | |
password = '' # insert your one here | |
tokensFile = 'miso_tokens.txt' | |
letsGo = gomiso() | |
if letsGo.authentification(consumer_key, consumer_secret, username, password, tokensFile): | |
json_result = json.loads(letsGo.getUserInfo()) | |
user_id = json_result['user']['id'] | |
json_result = json.loads(letsGo.userFeed(user_id, 1000)) | |
with open('gomiso_export.json', 'w') as outfile: | |
json.dump(json_result, outfile) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment