1
<%
SUB makeFeed(url)

Set xml = Server.CreateObject("Microsoft.XMLHTTP")

xml.Open "GET", url, False

xml.setRequestHeader "Client-ID", "*removed*"

xml.setRequestHeader "Accept", "application/vnd.twitchtv.v4+json"

xml.Send

sXml = xml.responseText

Response.write sXML

Set xml = Nothing

Set sXml = Nothing

end sub

makeFeed("https://api.twitch.tv/kraken/clips/top?limit=2&game=Overwatch&trending=true")

%>

How do I convert the json output so I can select what I want to show on the page instead of the entire thing?

Doc from the api: https://dev.twitch.tv/docs/v5/guides/clips-discovery/

mason
  • 31,774
  • 10
  • 77
  • 121
Zaaw32
  • 29
  • 1
  • 4
  • Oh sorry, new to this site, that was a mistake. – Zaaw32 Feb 07 '17 at 16:53
  • 1
    I have fixed it for you. Please be careful tagging in the future, as properly tagging your question helps it get seen by the correct people who might have a solution for you. – mason Feb 07 '17 at 16:57
  • ASP Classic (VBScript) does not have any native way of parsing JSON (as it predates it by quite a few years). What you need to either use an external library or JScript to parse it. There are various ones around, just search for "asp classic json" – Dijkgraaf Feb 08 '17 at 03:08
  • 2
    I find it's much easier to deal with json on the server side if you use JavaScript instead of VBscript... – Tim Williams Feb 08 '17 at 06:09
  • 1
    I second @TimWilliams on this. I've given an example in this question. http://stackoverflow.com/questions/30538292/asp-json-object-not-a-collection/30546374#30546374 – John Feb 08 '17 at 11:58
  • Try looking at https://github.com/rcdmk/aspJSON – pee2pee Feb 08 '17 at 15:12

0 Answers0