I'm not very good at this yet, not sure if my subject even accurately describes what I need. I know it's probably been answered, I'm having a hard time understanding the answers since they don't directly apply to my data. I am trying to figure out how I can iterate through the data in this URL.
http://tmi.twitch.tv/group/user/twitch/chatters
This is what I've been using.
Dim url = "http://tmi.twitch.tv/group/user/" & ConnectionInformation.Channel.TrimStart("#") & "/chatters"
Dim json As String = Nothing
Dim wc As New WebClient()
json = wc.DownloadString(url)
Dim root As JToken = JToken.Parse(json)
For Each item As JToken In root("chatters")
'I've tried several things here and I can't find a good way to iterate through the viewers found here.
Next
I guess I'm having trouble getting the viewers in a collection so that I can iterate through them, can someone point me in the right direction here?
Thank you.
"Chatters" is actually a Type in the root object. If you were to create classes, they would look like this:
Viewers is an array in the Chatters Property (
Root.Chatters.Viewers
). Without the class:Output:
If you were to deserialize to the classes: