Not Solved [How To?] Twitch random channels (list)
#1
Not Solved
Oke i normally dont post things like this for questions but this is for my forum website.

i want to show some random twitch broadcasters on my website into a screen, so if you refresh there will be a new one, i have made already a block menu for it.
but i dont know how to fix it, i want random streaming video's from twitch on my website, how can i make it possible?
[Image: PM8RRQ7.png]
Reply
#2
Not Solved
You can do it with jQuery

Add the following in your headerinclude template (or in the template you want to load the script)

<script type="text/javascript">
$('div.twitch_bc').hide().eq(Math.floor(Math.random() * $('div.twitch_bc').length)).show();
</script>

Your HTML Code:

<div id="twitch_content">
<div class="twitch_bc">First Broadcasters</div>
<div class="twitch_bc">Second Broadcaster</div>
<div class="twitch_bc">Third Broadcaster</div>
<div class="twitch_bc">Fourth Broadcaster</div>
</div>

http://jsbin.com/bazutogunu/1/edit?html,js,output
Reply
#3
Not Solved
the problem is how i can download the javascript? Cause that javascript wont be availible on the mybb cms right? And is it possible to change the sizes of the video playing?
[Image: PM8RRQ7.png]
Reply
#4
Not Solved
What? The script and HTML were posted above (you just have to change the text inside divs to HTML of the streams), no idea what you mean by "download the javascript".
Reply
#5
Not Solved
Which Javascript? For embed videos, see: https://github.com/justintv/Twitch-API/b...bedding.md
Reply
#6
Not Solved
Thanks Mipher, that was the right one, now im gonna add this on my website Smile
[Image: PM8RRQ7.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)