Twitch TV. Feedback & Help

Twitch TV. Feedback & Help
0

#1

Hi Campers,

I really need to know if I’m going in the right direction with my Twitch TV project. The Structure of the program is up, without the styling, but the JS seems quite convoluted and I still need to add more streamers. Any feedback, help, and advice would be much appreciated.

Regards David

Twitch TV Project


#2

Hi,

You are basically repeating the same code over and over again. Maybe you can come up with a function that takes a channel as parameter and then makes the AJAX request. Then you can call that function several times with different parameters.

Also, I would get rid of the divs with a specific id (#channel). You could use jQuery to create a div when the AJAX request is done and “fill it” with the status etc.


#3

Hi Ben,

Thanks for the reply. Some form of for loop is what I was thinking, I am usually not to bad with for loops, but for some reason I’m struggling with how to implement it with this API. That is why I am repeating the code, even though I know it is not the most efficient way to do it.

I think I’ll finish it this way, style it, and then make a copy and try to improve it. (Hopefully :slight_smile: )

Thanks for the pointers