-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgettvshows.php
More file actions
37 lines (26 loc) · 860 Bytes
/
gettvshows.php
File metadata and controls
37 lines (26 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
include "topline.php";
include "config.php";
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_URL, $xbmcjsonservice);
//prepare the field values being posted to the service
$request = '{"jsonrpc": "2.0", "method": "VideoLibrary.GetTVShows", "params" : { "sortorder" : "ascending" }, "id": 1}';
curl_setopt($ch, CURLOPT_POSTFIELDS, $request);
$array = json_decode(curl_exec($ch),true);
//results tv shows
$results = $array['result']['tvshows'];
echo "<div id=\"utility\"><ul>";
//loop tvshows
foreach ($results as $value)
{
//show sources
$label = $value['label'];
$tvshowid = urlencode($value['tvshowid']);
//change location to video id
echo "<li><a href=getseasons.php?tvshowid=$tvshowid>$label</a><li>";
}
echo "</ul></div>";
include "downline.php";
?>