source-Send_to_XBMC.php

beta 1 - tshif, 11/03/2009 10:14 am

Download (1.5 KB)

 
1
<?php
2
//this file is designed to be used as an include that is part of a loop.
3
//If a valid match is found, it should give $caller_id a value
4
//available variables for use are: $thenumber
5
//retreive website contents using get_url_contents($url);
6
7
//configuration / display parameters
8
//The description cannot contain "a" tags, but can contain limited HTML. Some HTML (like the a tags) will break the UI.
9
$source_desc = "This source will send the number and the Caller ID to XBMC.<br>Enter the URL to the destination XBMC in the format `url:port`.<br>This datasource should be one of the last data sources on your list, as it does not provide any data of its own, and can only send what information has been collected before it is run.";
10
$source_param = array();
11
$source_param['URL_address']['desc'] = 'Specify the URL:Port to the XMBC installation. (Example: http://script.somewhere.com:8080)';
12
$source_param['URL_address']['type'] = 'text';
13
$source_param['URL_address']['default'] = 'http://url:8080';
14
15
16
if($usage_mode == 'post processing')
17
{
18
        if (($run_param['URL_address'] !='') && ($first_caller_id != ''))
19
        {
20
21
                $clidxbmc=urlencode($first_caller_id.','.$thenumber);
22
                $url=$run_param['URL_address'].'/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification('.$clidxbmc.')';
23
                //$url=utf8_decode($run_param['URL_address']).'/xbmcCmds/xbmcHttp?command=ExecBuiltIn&parameter=XBMC.Notification('.$clidxbmc.')';
24
                if($debug)
25
                {
26
                        print 'Send to XBMC: '.$url.'<br><br>';
27
                }
28
                $value = get_url_contents($url);
29
        }
30
}
31
?>