Coder Social home page Coder Social logo

douyujs's Introduction

DouyuTV API Wrapper

NodeJS Wrapper for DouyuTV APIs

forked from yingnansong/douyujs

更新日志

v0.1.3

修改utils.deserialize避免对ic等包含'/'的字段继续序列化

v0.1.2

修改readme

v0.1.1

utils 根据 xiaozhuaiyingnansong#2 (comment) 的回复修改

按照 《斗鱼弹幕服务器第三方接入协议v1.6.2 》更新心跳包

Supported Platforms

This library has been tested with:

  • IO.js v2.5.0

Installation

npm install douyu

API Usage

// Import library
var douyu = require('douyu');

// Initialize Room entity
var roomID = "424559";
var room = new douyu.ChatRoom(roomID);

// System level events handler
room.on('connect', function(message){
	console.log('DouyuTV ChatRoom #' + roomID + ' connected.');
});
room.on('error', function(error){
	console.error('Error: ' + error.toString());
});
room.on('close', function(hasError){
	console.log('DouyuTV ChatRoom #' + roomID + ' disconnected' + hasError ? ' because of error.' : '.');
});

// Chat server events
room.on('chatmsg', function(message){
	console.log('[' + message.nn + ']: ' + message.txt);
});

// Knock, knock ...
room.open();

douyujs's People

Contributors

htzd2510 avatar yingnansong avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.