I did make another post about getting offline/online to show up, which has been resolved, however I figured best to open a new topic since this is different than the other one I made. Anyways … I am still working on trying to get this to work like I want to.
On there I have the full code that I have along with at the top comments on what I am wanting for it to do and what it actually IS doing. I’m hoping to get some help with this since I’m not sure what to do to get this to work how I’m looking to get it work. I’m new-ish on working with the twitch api for all this.
now shows the default image, however now it’s not showing the channel logo at all if there is a logo that actually exists. And still using the image of the last on the list for all streams. Progress but I’m still getting stumped.
Please use cURL most systems block file_get_contents being able to make HTTP/S requests. So please use cURL and retry. You should also be testing to see if you get a HTTP 200 when you make a request to the channel.
yea I just noticed that it’s not working right when I tried to swtich the list around. When I placed a online channel on the bottom with no logo set, it was a broken image. I’m still not seeing why it’s picking up the last on the array and using that picture for every other stream either.
subspace radio and eve radio both have logo’s set, but not displaying them, they are displaying the default logo that is set in the ‘file exists’ - channels that don’t have logo’s are still broken, and what I stated above (using same image).
all my names are lowercase but made no difference.
But in order to have the offline display names and logo’s I need to use that api from /channels not /streams, is there a way to break this up so it isn’t looping like it is now and pulling the same thing for all channels on the list?
You are reassigning the variables in the first foreach loop for each iteration. You need to assign the new values as properties of each channel… I think…