Need help with my twitch app

Need help with my twitch app
0

#1

I am nearly done with my Twitch app but I can not figure out how to display closed accounts. I am not sure what I am doing wrong and I feel like I have tried everything. Please help me. Here is my pen.


#2

hey @johnwm211 nice job thus far, if you do a console.log(streamData.stream) it will show the json you’ve received from your request, looking closely at it you will see the accounts that’s close (streamData.status: 422) or never exist (streamData.status: 404)
So from that you can do an if statement like :

    if (streamData.status == 404 || streamData.status == 422) {
     //display the HTML format here for the accounts that closed or don't exist
     using streamData.message to display the info about the accounts
    }

Hope that helps


#3

That makes perfect sense but it’s still not working. I have no idea what the problem is.


#4

Add &callback=? at the end of your ` urls.

Change if statement in stream JSON to if (streamData.stream == null && !data.message)


#5

Thank you so much @jenovs! That worked like a a charm!