function get_tweets_username($username_complete)
{
    if (function_exists('curl_init')) {
        // last tweets
        $username = str_replace("@", "", $username_complete);
        $url = "https://api.twitter.com/1/statuses/user_timeline/" . $username . ".json";
        $latest = curl_call($url);
        $latest_row = parser_twitter_results($latest, 0);
        update_option("skyscraper_latest", $latest_row);
        // last mentions
        $url = "http://search.twitter.com/search.json?q=@" . $username . "&rpp=5&include_entities=true&result_type=mixed";
        $mentions = curl_call($url);
        if (count($mentions["results"]) > 1) {
            $mentions_row = parser_twitter_results($mentions["results"], 1);
            update_option("skyscraper_mentions", $mentions_row);
        }
    }
}
Пример #2
0
} else {
    $token_expiry = 'No expiry time provided';
    $token_expiry_human = '';
}
if ($signed_request['issued_at']) {
    $token_issue = $signed_request['issued_at'];
    if (is_int($token_issue)) {
        $token_issue_human = '(' . date("M j Y, Hi e", $token_issue) . ')';
    }
} else {
    $token_issue = 'No issue time provided';
    $token_issue_human = '';
}
if ($signed_request['user_id']) {
    $user_id = $signed_request['user_id'];
    $user_name = json_decode(curl_call('https://graph.facebook.com/' . $signed_request['user_id']), true);
    $user_field = '<a href="' . $config['graph-explorer'] . $user_id . '" target="_blank">' . $user_id . '</a> (' . $user_name['name'] . ')';
} else {
    $user_field = 'No user ID provided';
}
?>

<body>
<div id="fb-root"></div>
<script>
  window.fbAsyncInit = function() {
    // init the FB JS SDK
    FB.init({
      appId      : '<?php 
echo $config['AppId'];
?>
Пример #3
0
    return $content;
}
$link = mysql_connect('mysql.montpellier.epsi.fr:5206', 'cars_user', 'cars34') or die('Impossible de se connecter : ' . mysql_error());
mysql_select_db('cars') or die('Impossible de sélectionner la base de données');
$models = array();
$file = 'page.html';
$content = curl_call('http://www.sra.asso.fr/zendsearch/automobiles/recherche?identifiant=&marque=&modele=&energie=&carrosserie=&puissance=&form_submit=1&url_recherche=/informations-vehicules/automobiles/recherche&url_fiche=/informations-vehicules/automobiles/fiche&itemPerPage=99', true, $file);
//$content = file_get_contents($file);
$doc = new DOMDocument();
$doc->loadHTML($content);
$count = 0;
$options = $doc->getElementById("marque")->getElementsByTagName("option");
foreach ($options as $option) {
    if ($option->getAttribute("value") != "") {
        $file = 'results.json';
        $result = curl_call('http://www.sra.asso.fr/zendsearch/automobiles/xhr-get-datas?type=modele&marque=' . $option->getAttribute('value') . '&modele=&energie=&carrosserie=&puissance=', true, $file);
        //$result = file_get_contents($file);
        $json_result = json_decode($result);
        foreach ($json_result->view as $json_model) {
            if ($json_model->key != "") {
                $model = array();
                $model["brand"] = $option->getAttribute("value");
                $model["brand_label"] = $option->nodeValue;
                $model["model"] = $json_model->key;
                $model["model_label"] = $json_model->value;
                $models[$model["brand"]][] = $model;
                pr($model);
                $query = 'INSERT INTO tasks (brand, brand_label, model, model_label, status) VALUES ("' . $model["brand"] . '", "' . $model["brand_label"] . '", "' . $model["model"] . '", "' . $model["model_label"] . '", "PENDING")';
                mysql_query($query) or die('Échec de la requête : ' . mysql_error());
            }
        }
Пример #4
0
}
function microtime_float()
{
    list($usec, $sec) = explode(" ", microtime());
    return (double) $usec + (double) $sec;
}
$previous_car = "";
$current_car = "";
$page = 1;
do {
    $begin_time = microtime_float();
    usleep(500000);
    $previous_car = $current_car;
    $url = "http://sra.asso.fr/zendsearch/automobiles/recherche?identifiant&marque={$brand}&modele={$model}&energie&carrosserie&puissance&form_submit=1&url_recherche=%2Finformations-vehicules%2Fautomobiles%2Frecherche&url_fiche=%2Finformations-vehicules%2Fautomobiles%2Ffiche&itemPerPage=99&f_p=1&page={$page}";
    $time1 = microtime_float();
    $result = curl_call($url);
    $time2 = microtime_float();
    echo "CURL query: " . ($time2 - $time1) . "s\n";
    if ($result) {
        $time3 = microtime_float();
        $doc = new DOMDocument();
        $doc->loadHTML($result);
        $time4 = microtime_float();
        echo "DOM loading: " . ($time4 - $time3) . "s\n";
        $time5 = microtime_float();
        $title = find_elements_by_class("h1", "titre", $doc);
        $titleValue = trim(find_elements_by_class("span", "orange", $title[0])[0]->nodeValue);
        $explodedTitle = explode(" - ", $titleValue);
        $car["brand"] = $explodedTitle[0];
        $car["model"] = $explodedTitle[1];
        $car["version"] = $explodedTitle[count($explodedTitle) - 1];
Пример #5
0
function adminindex_theme()
{
    global $theme, $globals, $user, $l;
    softheader($l['<title>']);
    echo '<script language="javascript" type="text/javascript" src="' . serverurls('latestinfo') . '"></script>

<script type="text/javascript">
function load_soft_info(){
	$_("softnews").style.width = $_("softnewsholder").offsetWidth;
	//The news
	if(typeof(soft_news) == "undefined"){
		$_("softnews").innerHTML = "' . $l['conect_to_soft'] . '";
	}else{
		var newsstr = "";
		for(x in soft_news){
			newsstr = newsstr+\'<div class="softnewshead">\'+soft_news[x][0]+\'</div>\'+\'<div class="softnewsblock">\'+soft_news[x][1]+\'</div><br />\';
		}
		$_("softnews").innerHTML = newsstr;
	}
	//The current version
	if(typeof(soft_latest_version) == "undefined"){
		$_("newsoftversion").innerHTML = "<i>' . $l['no_info'] . '</i>";
	}else{
		$_("newsoftversion").innerHTML = soft_latest_version;
	}
}
addonload(\'load_soft_info();\');
</script>

<br />
<div class="sai_divroundshad" style="width:690px; margin:0px auto;">
<table width="100%" cellpadding="1" cellspacing="1" class="sai_cbor">			
<tr>
<td class="header" align="center">
	<b>' . $l['news'] . '</b>
</td>
</tr>

<tr>
<td width="100%" class="cbgbor" height="200" valign="top" id="softnewsholder">
<div class="softnews" id="softnews"></div>
</td>
</tr>
</table>
</div>
<br /><br />';
    echo '
<div class="sai_divroundshad" style="width:650px; margin:0px auto; padding:20px;">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="75%" colspan="2">
<div align="center" class="infohead">' . $l['soft_info'] . '<br /></div>
<img src="' . $theme['images'] . 'hr.jpg" width="100%" height="1" alt="" /><br /><br />
</td>
</tr>
<tr>
<td>
<div class="softinfo">' . (!defined('SOFTRESELLER') ? '<b>' . $l['soft_license'] . '</b> : ' . $globals['license'] . ' (' . $globals['primary_ip'] . ')<br />
<b>' . $l['soft_license_type'] . '</b> : ' . (empty($globals['lictype']) ? $l['type_0'] . ' (<a href="' . serverurls('buy') . '" target="_blank">' . $l['become_premium'] . '</a>)&nbsp; (<a href="' . serverurls('pricing') . '" target="_blank">' . $l['pricing'] . '</a>)' : $l['type_1']) . '&nbsp; (<a href="' . $globals['ind'] . 'refreshlicense">' . $l['refreshlicense'] . '</a>)' . (asperapp(0, 1, 1) ? '&nbsp; (<a href="' . $globals['ind'] . 'act=licensekey">Enter License Key</a>)' : '') : '') . ' <br />
<b>' . $l['server_addr'] . '</b> : ' . $_SERVER['SERVER_ADDR'] . '  <br />
' . (!defined('SOFTRESELLER') ? '<b>' . $l['expires'] . '</b> : ' . (empty($globals['licexpires']) ? $l['never'] : makedate($globals['licexpires']) . ' (DD/MM/YYYY)') . '  <br />' : '') . '<b>' . $l['ip_license'] . '</b> : ' . @substr(curl_call(fastestmirror() . '/ip.php', 0, 5), 0, 16) . '<br />
<b>' . $l['php_version'] . '</b> : ' . sphpversion() . '<br />
<b>' . $l['soft_version'] . '</b> : ' . asperapp($globals['version'], @$globals['webuzo_version'], @$globals['ampps_version']) . '<br />
<b>' . $l['latest_soft_version'] . '</b> : <span id="newsoftversion"></span>
</div>
</td>';
    if ($globals['softpanel'] == 'ampps' || $globals['softpanel'] == 'webuzo') {
        echo '<td width="20%">
	<img src="' . $theme['images'] . $globals['softpanel'] . (empty($globals['lictype']) ? 'free' : 'premium') . '.png" width="100%" />
</td>';
    } else {
        echo '<td width="23%">
	<img src="' . $theme['images'] . 'softaculous' . (empty($globals['lictype']) ? 'free' : 'premium') . '.png" width="100%" />
</td>';
    }
    echo '</tr>
</table>
</div>

<br /><br />';
    softfooter();
}
Пример #6
0
        $token_issue_human = '(' . date("M j Y, Hi e", $token_issue) . ')';
    }
} else {
    $token_issue = 'No issue time provided';
    $token_issue_human = '';
}
if ($signed_request['user_id']) {
    $user_id = $signed_request['user_id'];
    $user_name = json_decode(curl_call('https://graph.facebook.com/' . $signed_request['user_id']), true);
    $user_field = '<a href="' . $config['graph-explorer'] . $user_id . '" target="_blank">' . $user_id . '</a> (' . $user_name['name'] . ')';
} else {
    $user_field = 'No user ID provided';
}
// /SIGNED REQUEST PROCESSING
// LIVE STATUS PROCESSING
$live_status = json_decode(curl_call('https://www.facebook.com/feeds/api_status.php'), true);
// Is Facebook pushing code?
if ($live_status['push']) {
    $push_status = $live_status['push']['status'];
} else {
    $push_status = 'Unknown';
}
// What is the status of the API?
if ($live_status['current']) {
    $health = $live_status['current']['health'];
    switch ($health) {
        case 0:
            $health_title = '<p class="text-info">Neutral</p>';
            break;
        case 1:
            $health_title = '<p class="text-success">Healthy</p>';