Skip to main content

Python Plurk Api

Project description

poaurk

Plurk + Oauth Library modify from the work by clsung's version.

Replace python-oauth library to requests-oauthlib.

Installation

pip install poaurk

Example

Authorize and get profile

# import package
from poaurk import (PlurkAPI, PlurkOAuth)

# Init a new plurk object
plurk = PlurkAPI("<consumer key>", "<consumer secret>")

# Authorize if no token
status, data = plurk.authorize()
if not status:
    # Failed
    print(data)

# Call api
status, data = plurk.callAPI('/APP/Profile/getOwnProfile') # status = True if successful
print(data)

Init from json file

Copy api.keys.example to yout project, modified it.

from poaurk import PlurkAPI

# Init
plurk = PlurkAPI.fromfile("api.keys")

# Get own profile
_, data = plurk.callAPI('/APP/Profile/getOwnProfile')
print(data)

# Get Public Profile from user_id
# User id can obtain from other api
_, data = plurk.callAPI('/APP/Profile/getPublicProfile', options={'user_id': '<user id>'})
print(data)

# Upload picture
_, data = plurk.callAPI('/APP/Timeline/uploadPicture', files={'image': '<image path>'})
print(data)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

poaurk-0.1.3-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page