Skip to main content

A plurk-bot pack with plurk-api wrapper written in Python.

Project description

PyPlurky

The best surface between Plurk Oauth and python.

This is a project that try to connect plurk_oauth and python better. Make it easier to use for python developer.

For more API information, please visit:

Why you need it

This project is to make "bot develop" easier. For some reasons, we need a plurk bot, but everything is not prepared. That is why we need it: A good dispatcher, handler, and easier function to call API. A good error manager for developing more efficiency. If you only want to develop plurk reader, it is also fine to ignore function like dispatcher.

Installation

pip install pyplurky

Or get the latest version.

git clone https://github.com/Dephilia/PyPlurky.git

Usage

Please check your API.keys file first.

from pyplurky import pyplurky,api

pk=pyplurky(mode="BOT",key="API.keys")

def addAllFriend(plurk):
    plurk.alerts.addAllAsFriends()

def sayHi(plurk,data):
    id=data.plurk_id
    plurk.responses.responseAdd(id,"Hi")


pk.addRepeatHandler(addAllFriend)

pk.addResponseHandler("Hi",sayHi)

pk.addPlurkHandler("Hi",sayHi)

if __name__=="__main__":
    pk.main()

The pyplurky parameter mode must be BOT or REPL. Under REPL mode, you can test some code like:

p.users.me()

addResponseHandler: Add key word that will post when a new plurk shows.

addPlurkHandler: Add key word that will post when a new response shows.

requirement

  • plurk-ouath (Please install dev version, cause there is some bugs in pip version)

Bugs in Plurk

Here shows some plurk bugs, not cause by module.

  1. cliques.add/remove will always return true
  2. No cliques delete
  3. block.block/unblock will always return true
  4. Comet Server instability

Future Work

  1. Complete All API at test console (not write on document)
  2. Function Handler (Plurk/Response/Continue) (Done)
  3. Routine Work
  4. Event Setter
  5. Use both getPlurk API and comet to prevent comet server problem.
  6. Async handler

Project details


Download files

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

Source Distribution

pyplurky-0.3.0.tar.gz (12.3 kB view hashes)

Uploaded Source

Built Distribution

pyplurky-0.3.0-py3-none-any.whl (14.9 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