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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file poaurk-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: poaurk-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.9.5

File hashes

Hashes for poaurk-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 74950bb9be7216e96226b6be43348a6ea1a7bd619499dc46d23b9a1f796373f5
MD5 a0fee943c5b6be3492b660f48815e05b
BLAKE2b-256 716d6cf90a57552b84a088474211fadee2be26e1316d64d23b5f97db073e119a

See more details on using hashes here.

Supported by

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