npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wanba-api-client

v1.0.9

Published

腾讯玩吧nodejs sdk

Downloads

2

Readme

#wanba-api-client

腾讯玩吧nodejs sdk

安装:

npm install wanba-api-client --save

使用:

var config = require('./config');
var wanba = require('./lib/wanba')(config);

方法调用

//玩吧支付
wanba.buyPlayzoneItem({
  openid:openid,
  openkey:openkey,
  itemid:2480
},function(error,body){
  console.log(error,body);
});

//获取已安装了应用的好友列表
wanba.getUserAppFriends({
  openid:openid,
  openkey:openkey,
  userip:userip
},function(error,body){
  console.log(error,body);
  //批量获得好友基本信息
  var fopenids = [];
  for(var i in body.items){
    fopenids.push(body.items[i].openid);
  }
  wanba.getUserMutiInfo({
    openid:openid,
    openkey:openkey,
    userip:userip,
    fopenids:fopenids
  },function(error,body){
    console.log(error,body);
  });
});

//上传用户等级信息
wanba.setUserAchievement({
  openid:openid,
  openkey:openkey,
  userip:userip,
  user_attr:{
    "level":1,//用户等级
    "area_name":"server_01"//多区多服应用需要输入该参数,非多区多服应用不需要传
  }
},function(error,body){
  console.log(error,body);
});


//拉取游戏的排行榜列表
wanba.getUserGamebarRanklist({
  openid:openid,
  openkey:openkey,
  userip:userip,
  rankdim:'level',//拉取纬度,需与排行榜配置信息表中一致
  rank_start:0,//拉取排行的起始位置(默认0)
  pull_cnt:0,//拉取排行的个数(最小为3,最大为50,默认3)
  direction:0//拉取排行的方向(-1往前拉取,0向后拉取,默认0)
},function(error,body){
  console.log(error,body);
});


//查询游戏用户信息和达人包月信息
wanba.getUserInfo({
  openid:openid,
  openkey:openkey,
  userip:userip,
  zoneid:1//区ID,用于区分用户是在哪一款平台下(Android、IOS等)
},function(error,body){
  console.log(error,body);
});

//向好友发送玩吧消息
wanba.sendGamebarMsg({
  openid:openid,
  openkey:openkey,
  userip:userip,
  zoneid:1,//区ID,用于区分用户是在哪一款平台下(Android、IOS等)
  frd:'DBCBF05FC24CFE1096D1A7D7B5E210DD',//好友openid
  msgtype:1,//消息类型,1-pk消息,2-送心消息,3-超越消息
  content:"10秒",//超越消息的积分文字,形如“10秒”,“100分”之类
  qua:'V1_AND_QZ_4.9.3_148_RDM_T'//手机空间版本标识,例如:V1_AND_QZ_4.9.3_148_RDM_T
},function(error,body){
  console.log(error,body);
});