Giter Club home page Giter Club logo

streamer's Introduction

Streamer

Streams of reasonably interesting data published reasonably stochastically

Turns pull based data into streams of data pushed to the client via web sockets every 3-5 seconds. Each data source is identified by a channel name and will return a payload with a consistent shape. This is meant for testing interfaces that rely on data streams rather than polling.

You can subscribe to a stream using Pusher in the browser like this:

<script src="https://js.pusher.com/4.2/pusher.min.js"></script>
<script>
  const stream = new Pusher('e8f388c50dfc938652ce', { cluster: 'eu' })
  stream.subscribe('SOME-CHANNEL-NAME').bind('default', console.log)
</script>

Or you can try it online on CodePen

Replace SOME-CHANNEL-NAME with one of the channels listed below and then open the console to see the data flowing in. Replace the console.log with a function that accepts a single argument that is the payload of the channel you have subscribed to. You can use the same stream to subscribe to multiple channels.

Channels

Below are a list of data streams by channel name. Some of them return generated mock data and others rely on live data points from open source or publicly available APIs.

Random Data

Channel Description
fact A random fact string from a large list of facts.
name A random name string form a large list of names.
color A randomly generated hex value like #00ffcc.
image A URL to a random image from unsplash.
percent A random number from 1-100 useful for graphs and dials.
location An object containing random but valid values for lat and lng.
roulette An object containing data that represents a random spin of a roulette wheel.
card An object containing data that represents a random card being drawn from a deck.

Live Data

Channel Description
time A human readable time string in GMT like 16:35:00 GMT.
date A date string based on a the number of milliseconds since 1 January 1970 UTC.
count The value of a counter that gets incremented every publish.
bitcoin The current price of bitcoin in US dollars.
footballer Up to date information about a random football player from the Premier League.
carbon The current carbon intensity level of the UK.

streamer's People

Contributors

lukejacksonn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

leesio hyno-ir

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.