New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

snsclient

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

snsclient

Multi-platform SNS client for node

latest
Source
npmnpm
Version
0.3.0
Version published
Maintainers
1
Created
Source

Multi-platform SNS Client for Node

This is general SNS Client libs for most SNS platforms.

Implemented:

  • "wyx" - Sina Weiyouxi (Old style FB like, in-frame only, implemented)
  • "renren" - RenRen (OAuth2, implemented)

Not implement yet:

  • "qq" - QZone/Pengyou
  • "fb" - Facebook
  • "google" - Google+
  • "kaixin" - Kaixin001

Implemented but not suggest to use

  • "sina" - Weibo (OAuth, implemented, but lack of sns CommonAPI)

How to use

To create a SNS client

var snsclient = require('snsclient');

var factory = snsclient({
	platform_nameA : {key: key, secret: secret},
	platform_nameB : {key: key, secret: secret}
});
	
var client_nouser, client_withuser;

client_nouser = factory.createClient('platform_nameA'); // for no authorized_user

factory.setDefault('platform_nameA'); // set a default platform
client_nouser = factory.createClient(); // for no authorized_user and using default

// set user and using default
// you can get authorized_user by snsClient's function "authorize()"
client_withuser = factory.createClient(authorized_user); 

To authorize

some authorization may be redirecting page

// create a default client
var client = factory.createClient(), authorized_user;
client.authorize(req, res, function(err, user){
	// if no err, user will be the authorized_user to be used in other CommonAPIs
	authorized_user = user;
});

Using commonAPIs

// create a default client with authorized_user
var client = factory.createClient(authorized_user);
client.friends_ids(null, /* you can set some API additional parameters here */
  function(err, data){
  //To handle data
});

Dependence

  • Using node-oauth lib
  • The lib should be run on express framework(for session and router support)

CommonAPIs

  • acccount_info : get current user's info
    • support: all
  • friends_ids : get user's friends ids
    • support: all(except weibo)
  • appfriends_ids : get user's app friends(installed current application) ids
    • support: all(except weibo)
  • appfriends_info : get user's app friends detail info
    • support: all(except weibo)
  • is_app_user : check if the user installed current application
    • support: all(except weibo)
  • users_info : get user's info by ids array
    • support: all(except weibo)

Contact me

  • Weibo: http://weibo.com/boisgames
  • Mail: btspoony[AT]gmail.com

Keywords

sdk

FAQs

Package last updated on 10 Dec 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts