Skip to content

Instantly share code, notes, and snippets.

@magicguitarist
Last active August 25, 2018 22:33
Show Gist options
  • Save magicguitarist/10929545 to your computer and use it in GitHub Desktop.
Save magicguitarist/10929545 to your computer and use it in GitHub Desktop.
A Dashing widget to add live twitch streams do your dashboard

Description

A Dashing widget to add live twitch streams to your dashboard.

Note that this is not really a productive widget (unless you are a streamer, I suppose). Our's is in the break room with weather and news widgets.

Usage

Make a folder called 'twitch' in your widgets directory. Add twitch.html and twitch.coffee to the twitch folder.

Add the widget HTML to your dashboard

    <li data-row="1" data-col="1" data-sizex="3" data-sizey="2">
        <div data-id="twitch" data-view="Twitch"></div>
    </li>

Use the following to switch channels:

curl -d '{ "auth_token": "YOUR_AUTH_TOKEN", "channel": "CHANNELNAME" }' \http://host:3030/widgets/twitch

if you have curl for windows in your path, you can use the batch file to make it easy!

@echo off
echo Enter Channel Name
setlocal
set /p channel=
curl -d {"""auth_token""":"""YOUR_AUTH_TOKEN""","""channel""":"""%channel%"""} http://host:3030/widgets/twitch
class Dashing.Twitch extends Dashing.Widget
<object type="application/x-shockwave-flash" height="700" width="990" id="live_embed_player_flash" data-bind-data="channel | prepend 'http://www.twitch.tv/widgets/live_embed_player.swf?start_volume=50&amp;channel='"></object>
@magicguitarist
Copy link
Author

Sorry for the slooow reply. Yes, if you modify the twitch.html. I've added the code in, and you should be able to modify to match pretty easily if you would rather not re-install. Volume goes from 0-100

@BritneyMuller
Copy link

Could I use this to pull in top twitch game / player data?

@stigert
Copy link

stigert commented Aug 25, 2018

where do I enter the twich channel?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment