Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
金山快盘SDK的ruby版本(the third party)
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
Gemfile
Gemfile.lock
README.rdoc
Rakefile
kuaipan.gemspec

README.rdoc

kuaipan.gem - the third part SDK of kuaipan@kingsoft.com

To install the gem simply enter:

gem install kuaipan

To see an example of how it works enter the following into your terminal:

git clone git://github.com/tiemei/kuaipan-example.git
gem install kuaipan
cd kuaipan-example
ruby example.rb

how to use ?

require 'kuaipan'
class YourAPI 
  include Kuaipan::OpenAPI
  def your_method
    # 1 config
    consumer_key = 'YourConsumerKey'
    consumer_secret = 'YourConsumerSecret'
    input_config(consumer_key, consumer_secret)

    # 2 authorize + get_access_token
    # k_session = g_session() # ok!
    # k_session = g_session(:oauth_callback => 'Your callbake url') # ok!
    # authorize_url = k_session[:authorize_url]
    # user input their username+pwd
    # then you should parse oauth_verifier
    k_session.set_atoken oauth_verifier

    # 3 use Kuaipan API(such as download file, upload file...)
    # please refer to test/test_client.rb
    k_session.account_info['user_id'] # get user_id
  end
end

restart to support this API 2013-03-17

Something went wrong with that request. Please try again.