function _get_line($h, $num)
{
    global $_handles;
    if (!isset($_handles[$h])) {
        return "";
    }
    // closest thing to an error
    $rv = _get_data($h);
    if ($rv === false) {
        return "";
    }
    // closest thing to an error
    return $rv[$num];
}
Example #2
0
$user_agent_full = "{$user_agent} ({$user_domain})";
$client_url = $_GET['u'];
$client_allowed = 1000;
/* Check for POST data for any-origin. Please note all POST data passes. */
$ao_post = "";
$ao_post_active = 0;
if ($_POST) {
    $ao_post_active = 1;
    $ao_post = http_build_query($_POST);
}
/* Continue with any-origin request */
header('Access-Control-Allow-Origin: *');
/* Safety Feature */
header('Content-Type: text/plain');
/* Continue */
print _get_data('http://magicseaweed.com/api/' . $client_url);
function _get_data($url)
{
    return file_get_contents($url);
}
function parseRequestHeaders()
{
    $headers = array();
    foreach ($_SERVER as $key => $value) {
        if (substr($key, 0, 5) != 'HTTP_') {
            continue;
        }
        $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
        $headers[strtolower($header)] = $value;
    }
    return $headers;
Example #3
0
if (in_array(strtolower($client_host), $allowed_hosts) || $allowed_hosts[0] == '*') {
    $client_allowed = 1;
}
/* Check for POST data for any-origin. Please note all POST data passes. */
$ao_post = "";
$ao_post_active = 0;
if ($_POST) {
    $ao_post_active = 1;
    $ao_post = http_build_query($_POST);
}
/* Continue with any-origin request */
header('Access-Control-Allow-Origin: *');
/* Safety Feature */
header('Content-Type: text/plain');
/* Continue */
$xml_string = _get_data(urldecode('http%3A//xmlfeed.laterooms.com/index.aspx' . $client_url));
$xml = simplexml_load_string($xml_string);
$json = json_encode($xml);
// $array = json_decode($json,TRUE);
echo $json;
function _get_data($url)
{
    return file_get_contents($url);
}
function parseRequestHeaders()
{
    $headers = array();
    foreach ($_SERVER as $key => $value) {
        if (substr($key, 0, 5) != 'HTTP_') {
            continue;
        }
Example #4
0
$ao_post = "";
$ao_post_active = 0;
if ($_POST) {
    $ao_post_active = 1;
    $ao_post = http_build_query($_POST);
}
/* Continue with any-origin request */
header('Access-Control-Allow-Origin: *');
/* Safety Feature */
header('Content-Type: text/plain');
/* Continue */
$timestamp = gmdate('U');
// 1427233130 (Tue, 24 Mar 2015 21:38:50 +0000)
$sig = md5($apiKey . $secret . $timestamp);
$add_to_url = "&apiKey=" . $apiKey . "&sig=" . $sig;
print _get_data('https://book.api.ean.com/ean-services/rs/hotel/v3/avail?' . urldecode($client_url) . $add_to_url);
function _get_data($url)
{
    return file_get_contents($url);
}
function parseRequestHeaders()
{
    $headers = array();
    foreach ($_SERVER as $key => $value) {
        if (substr($key, 0, 5) != 'HTTP_') {
            continue;
        }
        $header = str_replace(' ', '-', ucwords(str_replace('_', ' ', strtolower(substr($key, 5)))));
        $headers[strtolower($header)] = $value;
    }
    return $headers;