Skip to content
This repository has been archived by the owner on Jun 27, 2023. It is now read-only.

LitoMore/fanfou-streamer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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