Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Clone in Desktop Download ZIP
Player for tweets
JavaScript
Branch: master
Failed to load latest commit information.
lib Implemented pause
src Implemented pause
.eslintrc Lint
.gitignore init
.npmignore Removed index.js that is not used
LICENSE init
README.md Added ci status badge
example.js Added test
package.json 0.0.3
sample.json WIP
test.js Lint
test.json Added test

README.md

TweetPlayer

Build Status

Install

npm install tweet-player

Usage

play

import TweetPlayer from 'tweet-player';

const tweets = [
  {
    /// raw tweets json data
    /// See sample.json
  },
];

const interval = 500; /// default is 1000ms

player = new TweetPlayer(tweets);

player.play((tweets, isEnd, seeker) => {
  tweets.forEach((tweet) => {
    console.log(tweet.text);
  });
}, interval);

seekTo

play from the time specified

player.seekTo(1000, (tweets) => {
    // your code here
});

pause

pause player

player.play(() => {
  // callback
});

// will pause after 3000ms
setTimeout(() => {
  player.pause()

  // and restart after 3000ms from paused
  setTimeout(() => {
    player.play(() => {
      /// callback
    });
  }, 3000);
}, 3000);
Something went wrong with that request. Please try again.