Giter Site home page Giter Site logo

ymi.js's Introduction

ymi.js

Build Status Downloads Npm Version Node Version Issues

ymi.js is heavy influenced by the awesome tmi.js providing basic functionality to get a Youtube stream's chat messages from the Youtube API

Install

Node

npm install ymi.js --save

Usage

Node

const ymi = require('ymi')

const config = {
    oauth : {
        client_id: "1394...apps.googleusercontent.com",
        client_secret: "-mHmFvwL...",
        access_token: "ya29...",
        refresh_token: "1/zz_dq0vjjWc..."
    },
    live_chat_id: 'EiEKGFV...',
    page_token: null,
}

const client = new ymi.client(config)

client.on('connected', () => {
    console.log("connected")
})

client.on('chat', (user, message) => {
    console.log(user.displayName, message.displayMessage)
})

client.on('page_token', (page_token) => {

    console.log("New page token", page_token)
    // TODO: Persist to disk
})

client.on('refresh_token', (refresh_token) => {

    console.log("New refresh token", refresh_token)
    // TODO: Persist to disk
})

client.connect()
// Send a message to the stream's chat
client.say("Test message")

ymi.js's People

Contributors

m3talstorm avatar

Stargazers

mika avatar Umut.py avatar Nitin Khanna avatar ScuffSZN avatar  avatar Mohammad Ali Fallahi avatar Andrew Davis avatar Pavel Zloi avatar Thomas Lekanger avatar Josef Šíma avatar Lastorder avatar Dorian avatar  avatar James Frost avatar  avatar

Watchers

 avatar James Cloos avatar Dorian avatar Ezra avatar

ymi.js's Issues

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.