Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 80e8140643
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (27 sloc) 0.964 kb
import sys
sys.path.append('plurk_oauth/')
from PlurkAPI import PlurkAPI
import getopt
import json
def usage():
print '''Help Information:
-h: Show help information
'''
if __name__ == '__main__':
try:
opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
except getopt.GetoptError, err:
print str(err) # will print something like "option -a not recognized"
usage()
sys.exit(2)
file = open('API.keys', 'r+')
data = json.load(file)
plurk = PlurkAPI(data["CONSUMER_KEY"], data["CONSUMER_SECRET"])
if data.get('ACCESS_TOKEN'):
plurk.authorize(data["ACCESS_TOKEN"],data["ACCESS_TOKEN_SECRET"])
else:
plurk.authorize()
data["ACCESS_TOKEN"] = plurk._oauth.oauth_token['oauth_token']
data["ACCESS_TOKEN_SECRET"] = plurk._oauth.oauth_token['oauth_token_secret']
json.dump(data,file)
print plurk.callAPI('/APP/Profile/getOwnProfile')
Jump to Line
Something went wrong with that request. Please try again.