0.2.1 • Published 6 years ago

fanfou-streamer v0.2.1

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

fanfou-streamer

npm.io npm.io npm.io npm.io

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

License

MIT © LitoMore

0.2.1

6 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago