Project

tjplurk

0.0
No commit activity in last 3 years
No release in over 3 years
Plurk API Wrapper
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

>= 0
>= 0
 Project Readme

Install

$ gem install tjplurk

Usage

api = Tjplurk::API.new CONSUMER_KEY, CONSUMER_SECRET, TOKEN_KEY, TOKEN_SECRET
api.request('/APP/Users/me') # => Hash object
api.request('/APP/Timeline/plurkAdd', content: 'haha', qualifier: 'says') # => Hash object

You can save your CONSUMER_KEY, CONSUMER_SECRET, TOKEN_KEY, TOKEN_SECRET in $HOME/.tjplurk per line, and Tjplurk::API.new will work as well, for example:

api = Tjplurk::API.new
api.request('/APP/Users/me')

Set ENV['TJPLURK_FILE'] to customize the config file path.

Real Time Notification

require 'tjplurk'

api = Tjplurk::API.new
api.real_time do |plurk|
  jj plurk
end

Examples

Command Line Usage

For the first time, you should use tjplurk auth to get access token and secret:

$ tjplurk auth CONSUMER_KEY CONSUMER_SECRET
Authorize URL: http://www.plurk.com/OAuth/authorize?oauth_token=************
Enter Verification Number: *****
Key & secret successfully saved to "$HOME/.tjplurk".

Your consumer key/secret and token key/secret will be saved to $HOME/.tjplurk. Then you can use all Plurk API:

$ tjplurk api /APP/Users/me
$ tjplurk api /APP/Timeline/plurkAdd "content=hello world" qualifier=says

For more available API paths, see http://www.plurk.com/API

Pretty print

$ tjplurk api /APP/Users/me | python -mjson.tool
$ tjplurk api /APP/Users/me | ruby -rjson -e 'jj JSON.parse(ARGF.read)'

Commands

tjplurk auth CONSUMER_KEY CONSUMER_SECRET  # get access token interactivly.
tjplurk api PATH ["FOO=BAR" ...]           # send an API request.

Develop

Before running rspec, please create $HOME/.tjplurk first.