Anybody familiar with the Twitch.tv APIs?

Basically we want to tweak monstream.tv a bit more, and have it show things like the current stream name and what game is being played, etc, kind of like www.vidyavidya.de does. I can't find the right section of documentation to pull/display that API.

11 years ago*

Comment has been collapsed.

Isn't this what you're looking for?

11 years ago
Permalink

Comment has been collapsed.

That's a good starting point, I'll have to figure out how to get it to actually display on a website and CSS it too.

11 years ago
Permalink

Comment has been collapsed.

You just need to make a curl request to your stream (https://api.twitch.tv/kraken/streams/yourchannelname). Then json_decode (assoc) the response and you'll have a nice array with stream info. The rest is just displaying it wherever you want it :-)

11 years ago
Permalink

Comment has been collapsed.

This is a really good start, but I might need someone a bit more web-savvy to help me get the API pull/request integrated. We run wordpress with a custom theme up, so formatting it and getting it laid out properly is going to be rough.

11 years ago
Permalink

Comment has been collapsed.

If you know what stream info you want and where to display it then I might be able to help you.
I have ~1 hour experience with Wordpress but i managed to do this. By default it shows my twitch.tv channel, but you can change it to whatever you want by using a "stream" variable:
?stream=monstream
?stream=taketv - this one is online right now
Moving stuff around with your custom theme shouldn't be that hard to do :-)

11 years ago
Permalink

Comment has been collapsed.

I don't REALLY need an online/offline indicator, as the stream itself will do that (we have an offline image up)

I'd ideally like it to show the title of the stream - and the game we are currently streaming and some sort of IF statement that if we're offline it says "Monstream is not currently live" instead of "Now Playing: %GAME%" If that's possible.

Also a number of viewers displayed in text would be ideal, as I like to see that info at-a-glance rather than hovering over the video.

11 years ago
Permalink

Comment has been collapsed.

Ok, my previous example was static so I came up with onother one - this time it dynamicaly refreshes stream info.
JS file
Working example

It's really simple:

  • 2nd line: change channel name to "monstream"
  • 25th line: set refresh interval in miliseconds (currently it's 5 seconds (5000ms))
  • parseResponse function: change it to whatever you like to display stream data
11 years ago
Permalink

Comment has been collapsed.

shoot man, thank you so much. I'm going to start implementing this right now and I'll test it all out. I added you on Steam, I might need to shoot you a message or two but I'm hoping this does it for me :)

EDIT: After messaging you on Steam we got this working, thank you!

11 years ago
Permalink

Comment has been collapsed.

My god, it's been forever since I've heard from Cornelious! I don't know anything about Twitch, but it's good to hear from you!

11 years ago
Permalink

Comment has been collapsed.

Thanks sir! Been extremely busy, got a job situation change, got married, bought a house, all exciting things, but I'm finally able to set aside some time at least a few nights a week to game, and stream :)

11 years ago
Permalink

Comment has been collapsed.

Oh wow! Congratulations, that's great to hear! It's good that you're getting some free time now, should I say welcome back? Yes, I will. Welcome back :)

11 years ago
Permalink

Comment has been collapsed.

Thanks sir! Yes, I have some nice things up my sleeve coming, been sitting on over $2k worth of codes to give out - so be sure to keep an eye on Monstream ;)

11 years ago
Permalink

Comment has been collapsed.

Is that change is the reason i can't enter Monstream today ? Cornelious

11 years ago
Permalink

Comment has been collapsed.

The site should work fine, are you getting an error? Screenshots? I'm not sure why it would cause an issue, I haven't implemented anything yet.

11 years ago
Permalink

Comment has been collapsed.

wrong address, sorry i got into the wrong site, i make mistake between monstream.tv and monstream.net . That what happen google fail to get what you want

11 years ago
Permalink

Comment has been collapsed.

Ah ok, good to know. I was checking with chrome, IE, safari, and firefox, to see if anything i had changed made it blow up in one of them :P

11 years ago
Permalink

Comment has been collapsed.

Closed 11 years ago by CorneliousJD.