Fanfou Streaming SDK for Node.js
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
.npmrc
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

fanfou-streamer

Fanfou Streaming SDK for Node.js

Install

$ npm install fanfou-streamer

Usage

const Streamer = require('fanfou-streamer')

const streamer = new Streamer({
  consumerKey: '',
  consumerSecret: '',
  oauthToken: '',
  oauthTokenSecret: ''
})

streamer.start()

streamer.on('message.reply', data => {
  console.log(data)
})

streamer.on('message.mention', data => {
  console.log(data)
})

For the data structures of these events respectively please refer to the Fanfou Streaming API docs.

Events

  • message.delete
  • message.reply
  • message.mention
  • user.updateprofile
  • friends.create
  • friends.delete
  • friends.request
  • fav.create
  • fav.delete
  • dm.create

API

streamer.start()

Start streaming.

streamer.stop()

Stop streaming.

streamer.on(eventName, listener)

Example:

streamer.on('message.reply', data => {
  console.log(data)
})

Related

Maintainer

License

MIT © LitoMore