2014-04-16, 20:49
Hi All,
I am a bit of a newbie. I am curretnly on Frodo.
I am trying to create a web page that is hosted within my own network. I want to return my list of latest movies using PHP. I have the following code and it is not working:
Unfortunately it is not parsing the latest 6 movies in my library... If I type the link
into my browser, I get code that looks like this:
With my PHP I should be able to get each of the "labels" above; but my list is empty.
Can someone please tell me what I am doing wrong?
Any advice is greatly appreciated.
Thanks,
Hernando
I am a bit of a newbie. I am curretnly on Frodo.
I am trying to create a web page that is hosted within my own network. I want to return my list of latest movies using PHP. I have the following code and it is not working:
Code:
<?php
$response = file_get_contents("http://192.168.0.103/jsonrpc?request={\"jsonrpc\":\"2.0\",\"method\":\"VideoLibrary.GetRecentlyAddedMovies\",\"id\":\"mybash\"}");
$result = json_decode($response, true);
for ($i = 0; $i <= 5; $i++) {
echo $result[$i]['label'];
echo "<br>";
}
?>
Unfortunately it is not parsing the latest 6 movies in my library... If I type the link
Code:
http://192.168.0.103/jsonrpc?request={"jsonrpc":"2.0","method":"VideoLibrary.GetRecentlyAddedMovies","id": "mybash"}
into my browser, I get code that looks like this:
Code:
{"id":"mybash","jsonrpc":"2.0","result":{"limits":{"end":105,"start":0,"total":105},"movies":[{"label":"A Thousand Times Good Night","movieid":1161},{"label":"Labor Day","movieid":1160},{"label":"The Nut Job","movieid":1159},{"label":"Braveheart","movieid":1158},{"label":"Zulu","movieid":1156},{"label":"55 Days at Peking","movieid":1155},{"label":"At Middleton","movieid":1153},{"label":"The Immigrant","movieid":1152},{"label":"Stand by Me","movieid":1151},{"label":"About Time","movieid":1150},{"label":"The Berlin File","movieid":1149},{"label":"Once Upon a Time in the West","movieid":1146},{"label":"Exit Through the Gift Shop","movieid":1143},{"label":"Rigor Mortis","movieid":...
With my PHP I should be able to get each of the "labels" above; but my list is empty.
Can someone please tell me what I am doing wrong?
Any advice is greatly appreciated.
Thanks,
Hernando