MyBB Community Forums

Full Version: Twitch random channels (list)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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?
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
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?
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".
Which Javascript? For embed videos, see: https://github.com/justintv/Twitch-API/b...bedding.md
Thanks Mipher, that was the right one, now im gonna add this on my website Smile