zuber
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2015
07:26 AM
JSON PARSE from URL
I am trying to Prase JSON file from URL instead of the reading from Package.
I am using sample from Roku. https://blog.roku.com/developer/2012/07/16/json-support-comes-to-roku/
How can I change following code to read from URL instead of "pkg:/json/cp.json")
Thanks
I am using sample from Roku. https://blog.roku.com/developer/2012/07/16/json-support-comes-to-roku/
How can I change following code to read from URL instead of "pkg:/json/cp.json")
Function LoadJSONFile() as void
jsonAsString = ReadAsciiFile("pkg:/json/cp.json")
m.json = ParseJSON(jsonAsString)
ShowPosterScreen(m.json.videos, true)
End Function
Thanks
4 REPLIES 4
snarler
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2015
09:10 AM
Re: JSON PARSE from URL
From digging deeper into their docs yields this snippet from an example...
...granted I'd probably do some error checking, null checking, etc. as appropriate 🙂
searchRequest = CreateObject("roUrlTransfer")
searchRequest.SetURL("http://api.example.com/services/rest/getPhotos")
response = ParseJson(searchRequest.GetToString())
...granted I'd probably do some error checking, null checking, etc. as appropriate 🙂
zuber
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2015
09:40 AM
Re: JSON PARSE from URL
Thanks...I am sure that is it... but I will test it out..
Just one more question...
Do you know how I can add more than one source? meaning you know how in VideoPlayer we have categories and leaf under it.
Can you please share how we can do something like that here? 2 different JSON url for 2 different playlist/shows.
Just one more question...
Do you know how I can add more than one source? meaning you know how in VideoPlayer we have categories and leaf under it.
Can you please share how we can do something like that here? 2 different JSON url for 2 different playlist/shows.

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2015
01:23 PM
Re: JSON PARSE from URL
This belongs in the Roku Developer Forum.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
zuber
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-10-2015
01:52 PM
Re: JSON PARSE from URL
sorry didn't notice that.
TheEndLess Can you please help me here?
TheEndLess Can you please help me here?