@aestetype/node-social-api
Node social api
Last updated 2 years ago by zadkiel .
Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @aestetype/node-social-api 
SYNC missed versions from official npm registry.

npm version Build Status Coverage Status Dependency Status devDependency Status

node-social-api

Documentation

Examples

Social api client for node that support promises and callback. Include:

Install

npm install --save node-social-api

Usage

import { Instagram, Twitter, Facebook, Tumblr } from 'node-social-api';

// Instagram
const instagram = new Instagram({
  clientId: 'your-client-id',
  accessToken: 'user-access-token',
});

// Some get query with promise
instagram.get('users/self').then((data) => {
  console.log(data);
});

// Some get query with callback
instagram.get('users/self', (err, data) => {
  console.log(data);
});

// Create a new stream and only receive new messages
const stream = instagram.stream('tags/:tag-name/media/recent');

stream.on('message', (message) => {
  console.log(message);
});

// Twitter
const twitter = new Twitter({
  consumerKey: 'your-consumer-key',
  consumerSecret: 'your-consumer-secret',
  accessToken: 'your-access-token',
  accessTokenSecret: 'your-access-token-secret',
});

// Some get query
twitter.get('media/recent').then((data) => {
  console.log(data);
});

// Facebook
const facebook = new Facebook({
  appId: 'your-app-id',
  appSecret: 'your-app-secret',
});

// Some get query
facebook.get(':some-id').then((data) => {
  console.log(data);
});

// Tumblr
const tumblr = new Tumblr({
  consumerKey: 'your-consumer-key',
});

// Some get query
tumblr.get('blog/scipsy.tumblr.com/info').then((data) => {
  console.log(data);
});

// Github
const github = new Github({
  accessToken: 'your-access-token',
});

// Some get query
github.get(':some-github-route').then((data) => {
  console.log(data);
});

Current Tags

  • 0.0.10                                ...           latest (2 years ago)

7 Versions

  • 0.0.10                                ...           2 years ago
  • 0.0.7                                ...           3 years ago
  • 0.0.6                                ...           3 years ago
  • 0.0.5                                ...           3 years ago
  • 0.0.4                                ...           3 years ago
  • 0.0.3                                ...           3 years ago
  • 0.0.2                                ...           3 years ago
Maintainers (2)
Downloads
Today 0
This Week 7
This Month 22
Last Day 0
Last Week 0
Last Month 2
Dependencies (2)
Dev Dependencies (18)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |