2014-06-08, 13:55
Hi,
I am very new to JSON and am not very good with js as is.
I am trying to display tvshow.poster in a <img>.
When I run the above in the url of a browser i get:
So I have
$raw_art = ""; //raw art = the url from above with %2f etc instead of /
$art = rawurldecode($raw_art); // converts it from %2f to / etc
Now I want my webpage to run this and then take the url for only tvshow.poster & movie.post (I think there is that as well?) and the echo that into a img
How do I run a JSON command in php and then take the required element (tvshow.poster) into $raw_art?
This is what I have so far
http://pastebin.com/YXfKTi8y
Any help would be great.
Thanks in advanced
I am very new to JSON and am not very good with js as is.
I am trying to display tvshow.poster in a <img>.
Code:
http://localhost:8080/jsonrpc?request=jsonrpc? {"jsonrpc": "2.0", "method": "Player.GetItem", "params": { "properties": ["title", "album", "artist", "season", "episode", "runtime", "showtitle","tvshowid", "file", "art"], "playerid": 1 }, "id": "1"}
When I run the above in the url of a browser i get:
Quote:{"id":1,"jsonrpc":"2.0","result":{"item":{"art":{"thumb":"image://http%3a%2f%2fthetvdb.com%2fbanners%2fepisodes%2f247808%2f4676426.jpg/","tvshow.banner":"image://http%3a%2f%2fthetvdb.com%2fbanners%2fgraphical%2f247808-g4.jpg/","tvshow.fanart":"image://http%3a%2f%2fthetvdb.com%2fbanners%2ffanart%2foriginal%2f247808-5.jpg/","tvshow.poster":"image://http%3a%2f%2fthetvdb.com%2fbanners%2fposters%2f247808-6.jpg/"},"id":37,"label":"Moot Point","title":"Moot Point","type":"episode"}}}
So I have
$raw_art = ""; //raw art = the url from above with %2f etc instead of /
$art = rawurldecode($raw_art); // converts it from %2f to / etc
Now I want my webpage to run this and then take the url for only tvshow.poster & movie.post (I think there is that as well?) and the echo that into a img
Code:
<img src="<?php echo $poster ?>" width="136" height="200">
How do I run a JSON command in php and then take the required element (tvshow.poster) into $raw_art?
This is what I have so far
http://pastebin.com/YXfKTi8y
Any help would be great.
Thanks in advanced