|
Hi there,
UPDATE: I got a LOT of questions about the TwitchList channel switcher I created for my website www.maegis.net. I created a standalone code that can be easily integrated into any website with minimal html skills. You can find an example site of the "as is" code at http://www.maegis.net/twitchlist/. To download the code + images in a convenient zipfile go to this link zipfile
Abstract With this topic I want to introduce to the team liquid community, a script that generates a stream list for your website composed of stream channels selected by you. The required files can be downloaded from links below.
Background This last week I have been working on my new teams website and decided that I wanted to have a custom stream-list module to tell if any of our teams members where currently streaming. Sadly I discovered there were no such modules available and the pieces of code I did find where ridiculously slow.
the script So I decided to create my own script and now that it is working I want to make it available for other teams that want one on their website.
So what does the script do? It checks a custom list of twitch channel names for being off or online. If a channel is found to be online the title is showed as well as the amount of viewers watching the stream. Here is an image of it working on my joomla based team site. www.maegis.net.
![[image loading]](http://i.imgur.com/9HQwM.png)
For now the script comes in 2 forms, as a single php file with some images that anyone should be able to incorporate to their site and as a joomla module.
The php file To make the script file work the following line must be edited to check the twitch channels of your choosing. members = array("maegis","androide456","avonmexicola","iksf"); the names between "" are all twitch tv stream channel (i.e. http://www.twitch.tv/maegis ). Simply add the channels names of your choosing separated by a comma and the script should do the rest.
the Joomla module The joomla module is version 2.5 compatible and can be installed using the joomla back-end admin panel. From here navigate to Extensions -> Extension manager and choose upload package file. Select the mod_twitchlist.zip file and press upload. After a successful installation go to Extensions -> Module Manager and enable the Twitch List module. Click on the Twitch link to configure it. Make sure you add a position and assign the module to some of your pages. Under basic options you can add the user list. This list is once again a comma separated list of twitch channels (i.e. eg_idra,rootcatz,liquidhero ) make sure not to use spaces. The module should now appear and function on your joomla website.
Download locations For now both zip files can be downloaded from my website. You can get the joomla module here and the php script file + images here
Future plans and development This is of course still a very early version of the script. I intend to develop a full component that can fill an entire page featuring thumbnails and viewers in a next release. If meanwhile you have any suggestions for features please post them in this topic and I'll see what I can do. I hope some of you will enjoy using this module as much as I enjoyed making it.
Cheers,
Avon
|
I can confirm this is awesome
|
I can confirm this is reasonably well done
|
|
|
Looks sweet, how long it take to make?
|
That's awesome! Make sure that you check whether the cURL extension (http://php.net/manual/en/book.curl.php) is available because file_get_contents won't work on a lot of shared hosts because they generally turn (http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen) off.
|
On December 29 2012 00:34 WillS wrote: That's awesome! Make sure that you check whether the cURL extension (http://php.net/manual/en/book.curl.php) is available because file_get_contents won't work on a lot of shared hosts because they generally turn (http://php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen) off.
I believe this function is only used in the joomla mod, for getting the list of channel users from twitch (for joomla to funtion this function has to be available). The none joomla script requires you to add this list into the twitch_list.php yourself.
|
On December 28 2012 01:07 lordofsoup wrote: Looks sweet, how long it take to make?
Since it was the first time I ever tried coding anything in PHP.. a week lol. I went from ~700 lines back to ~70 hahaha.
|
I think you can refactor quite a bit in your code, when it comes to readability. I didn't check the Joomla code since I'm not familiar with any functions concerning Joomla, but I saw some things that had me wondering in the normal PHP code.
You don't need to initialize the counter variable in every foreach loop if you don't use it. By standard it always uses the $value variable. Try to name the $value in a fashion so everyone knows what is in the value, just by looking at the loop. Also since $i and $value are both loop variables you don't need to unset them after your loop is finished (not really a mistake, but it reduces the lines used)
Those are just two things I just saw looking at the code in editor, maybe I can give you some more advice later today 
But all in all I like the idea and the code is really good for your first PHP code :D
**EDIT**
I refactored the code a bit and changed/deleted some functions (used in_array instead of two foreach loops) You can look at it here: http://pastebin.com/vQJZ5r7C
Hope it is okay
|
Cool thanks, I will have a look
|
|
|
Cool! Thanks for sharing.
|
Awesome, been what I have been looking for. Mind releasing the code that you have on your website, or a walkthrough? I am using the joomla module, but I want the stream links to link to my own internal page where it passes the user variable into an iframe of sorts.
Thanks!
|
Hi. Thx for the Code. But can someone help me. I want to integrate in the streamlist also hashd.tv streams. I try everythink but it doesnt work. PLS help.
Thx Ronagan
|
Hi people, I got a lot of pm's about the stream list thingie located at www.maegis.net.SO i created the following update to the topic:
UPDATE: I got a LOT of questions about the TwitchList channel switcher I created for my website www.maegis.net. I created a standalone code that can be easily integrated into any website with minimal html skills. You can find an example site of the "as is" code at http://www.maegis.net/twitchlist/. To download the code + images in a convenient zipfile go to this link zipfile
@Ronagan Please see if that code helps you!
|
Is this available to Blogger.com?
There is Widget > HTML / Javascript there
I was really looking for such thing.
|
Surprised to see that you didn't use my refactored version up until now, since it's much cleaner and has about 50 lines less code.
@Ronagan hasd.tv uses pretty much the same API as twitch.tv does, you just need to change some indeces when filling your arrays and checking the return array. And you need to check every channel by its own, since you can't hand over a list of channels.
|
On May 26 2013 22:03 Zumm wrote: Surprised to see that you didn't use my refactored version up until now, since it's much cleaner and has about 50 lines less code.
@Ronagan hasd.tv uses pretty much the same API as twitch.tv does, you just need to change some indeces when filling your arrays and checking the return array. And you need to check every channel by its own, since you can't hand over a list of channels.
I tried using your version, but did not get it to work!.. therefore I simply went back to what did work.
|
this script doesnt work.Is any possible to add on page automatcaly online streams from directory League of Legends?I mean streams not their status.Wordpress or Joomla or whatever.
|
Just what I was looking for, about to try it on Joomla now, thanks man.
|
i dont know how to get this work on our clanpage, can someone explain me how that works? we are using the cms dzcp and i saved the php file in the menu function folder and linked it i with [twichlist] in html. Its not working in this way for me, need help :/
|
Hey just wanted to say thanks for the script. I been hurting my brain trying to look for one or create one. I've tried a bunch of em but I got to say this was by far the easiest to work with! Here is your script implemented onto my gaming organizations website.
http://n2pgaming.com/streams.php
Nice work!
|
hey if i wanted to add what game they play how do i do that
|
Nice Going to be really cool asset for team sites and community sites etc!
|
On July 07 2013 01:48 esuom wrote:Hey just wanted to say thanks for the script. I been hurting my brain trying to look for one or create one. I've tried a bunch of em but I got to say this was by far the easiest to work with! Here is your script implemented onto my gaming organizations website. http://n2pgaming.com/streams.phpNice work! Hey man your page looks so good =) This is the kind of thing i was looking for. Where can i contact LKFX esports design media and may i ask how much did they charge? Before contacting them i wanna be sure they are in my budget limit :D
edit: Are they still doing any work? İt seems their website is down and there is only deviant art :/
|
On July 29 2013 02:41 lastzombie wrote:Show nested quote +On July 07 2013 01:48 esuom wrote:Hey just wanted to say thanks for the script. I been hurting my brain trying to look for one or create one. I've tried a bunch of em but I got to say this was by far the easiest to work with! Here is your script implemented onto my gaming organizations website. http://n2pgaming.com/streams.phpNice work! Hey man your page looks so good =) This is the kind of thing i was looking for. Where can i contact LKFX esports design media and may i ask how much did they charge? Before contacting them i wanna be sure they are in my budget limit :D edit: Are they still doing any work? İt seems their website is down and there is only deviant art :/
Yea we got it a while ago, I don't think they do any work anymore. But can probably just take one off deviant art
|
I can sell it to you if you like.
|
I noticed that the viewer counter is no longer working. Is there any way to fix it?
|
Your sample Picture looks good! BUT the script is not working anymore... It only gives out an "403 Forbidden" Error. Is anybody able to fix that? Or any solution for that? Would be very nice...
|
On February 26 2014 01:00 MrSmith777 wrote: Your sample Picture looks good! BUT the script is not working anymore... It only gives out an "403 Forbidden" Error. Is anybody able to fix that? Or any solution for that? Would be very nice...
Our clan site moved hosts il try get a message to avon to update the link.
|
Hey I really loved using this script.. but justin.tv API just went down.. if you can update it using twitch api I would appreciate :D
|
Yeah, love this script! Would be great if you could update it to twitch ^^
|
|
|
Johto4979 Posts
|
Hey guys I actually updated everything to the new API. Sorry to wake a dead topic I will add new links soon. Code is still a bit rough but thinking of adding some new cute features. The Joomla version is way more advanced now. It has settings from the control panel for various options and supports hashd as well.
|
Here is a link to the new Twitch api 2.0 channel switcher: LINK1 Here is a link to the zip file with the .php .css and images: LINK!
Here is a link to the fancy new joomla module: LINK!
|
I know it's a pretty old topic, but has anyone figured out how to get it to work? I mean, I don't want the channel switcher, all I need is stream list on a website. I tried to work with the last code from Avon, with that php file and with the code provided by Zumm (http://pastebin.com/vQJZ5r7C) by changing the API's from justin to twitch, and names of arrays and so on, but can't get it to work. Streams show offline anyway. Any help? I know it's not a lot of code, but I wonder which part am I missing.
|
GRAND OLD AMERICA16375 Posts
On July 24 2015 19:42 Zythus wrote: I know it's a pretty old topic, but has anyone figured out how to get it to work? I mean, I don't want the channel switcher, all I need is stream list on a website. I tried to work with the last code from Avon, with that php file and with the code provided by Zumm (http://pastebin.com/vQJZ5r7C) by changing the API's from justin to twitch, and names of arrays and so on, but can't get it to work. Streams show offline anyway. Any help? I know it's not a lot of code, but I wonder which part am I missing. https://github.com/justintv/twitch-api
|
Great script! Loved it. When I click on a online streamer it only shows my website = not directly too a twitch page.
|
|
|
Hey guys! Sorry to bump this thread, but I have a question for the guy who did the Channel Switcher, or anyone really that may know. The API, I am assuming, is out of date. But going through I don't actually see anything wrong. It says everyone is offline which isn't the case. I click the stream name it updates just fine showing the live feed. Any code savvy people see what might be incorrect?
|
|
|
|
|
|