Simple Wrapper of Plurk OAuth API
Plurk-OAuth is a wrapper for Plurk API 2.0 beta You will need to Sign Up for your own CUSTOMER TOKENs.
simply:
$ pip install plurk-oauth
for development:
$ git clone git@github.com:clsung/plurk-oauth.git
$ cd plurk-oauth
$ pip install -e .
You will need to save CONSUMER_KEY/CONSUMER_SECRET in API.keys, the format is JSON. The example is below:
{"CONSUMER_SECRET": "I_am_consumer_secret", "ACCESS_TOKEN": "your_access_token", "ACCESS_TOKEN_SECRET": "your_access_token_secret", "CONSUMER_KEY": "I_am_consumer_key"}
from plurk_oauth import PlurkAPI
plurk = PlurkAPI.fromfile(<path_to_API.keys>)
print(plurk.callAPI('/APP/Profile/getOwnProfile'))
from plurk_oauth import PlurkAPI
plurk = PlurkAPI(CONSUMER_KEY, CONSUMER_SECRET)
plurk.authorize(ACCESS_TOKEN,ACCESS_TOKEN_SECRET)
print(plurk.callAPI('/APP/Profile/getOwnProfile'))
print(plurk.callAPI('/APP/Profile/getPublicProfile', options={'user_id': 4203050}))
print(plurk.callAPI('/APP/Timeline/uploadPicture', files={'image': '../testimg.jpg'}))
from plurk_oauth import PlurkAPI
plurk = PlurkAPI(CONSUMER_KEY, CONSUMER_SECRET)
plurk.authorize()
print(plurk.callAPI('/APP/Profile/getOwnProfile'))
- Code:
git clone git://github.com/clsung/plurk-oauth.git
- Home: http://github.com/clsung/plurk-oauth
- Bugs: http://github.com/clsung/plurk-oauth/issues
Cheng-Lung Sung :: clsung@gmail.com :: @clsung