Qplus

Qplus 平台第三方应用后端SDK。

Installation

Add this line to your application's Gemfile:

gem 'qplus'

And then execute:

$ bundle

Or install it yourself as:

$ gem install qplus

Usage

require 'qplus'

qplus = Qplus::App.new 'your_app_id', 'your_app_secret'
  • check sig
qplus.check_sig url
  • check login
user_data = {
  :app_openid => "your user app_openid here",
  :app_openkey => "your user app_openkey here",
  :app_userip => "your user app_userip"
}

result = qplus. user_data

if result['ret']==0 && result['valide']==1
  puts 'logined'
end
  • get user info
result = qplus.get_userinfo user_data
if result['ret']==0
  nick = result['info']['nick']
  gender = result['info']['gender']
  face = result['info']['face']
  outh = result['info']['outh']
end
  • push
push_data = {
  "NUM" => 99,
  "APPCUSTOMIZE" => "param=你好",
  "INSTANCEID" => 0,
  "OPTYPE" => 1,
  "QPLUSID" => "9989C2EB77FB4217076688D02925CED3",
  "TEXT" => "你们好吗",
  "PUSHMSGID" => 1
}

result = qplus.push push_data

if result['ERRCODE']==0
  puts 'success'
end

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request