Esempio n. 1
0
function process($like_object, $additional, $fbuid, $domain = NULL)
{
    global $conf;
    $domain = 'fxp.co.il -site:fxp.co.il/archive';
    //$domain = 'fxp.co.il/archive';
    //$domain = NULL;
    save_like($like_object, $additional, $fbuid);
    $translation = get_translation($like_object['id'], $like_object['name']);
    $query = '"' . $translation . '"';
    if ($translation == '') {
        $query = '"' . $like_object['name'] . '"';
    }
    if ($domain != NULL) {
        $query .= " site:" . $domain;
    }
    //get bing data
    $results = getBingData($query);
    //Add category data
    if (is_array($results)) {
        foreach ($results as $entry) {
            if (is_null($entry)) {
                continue;
            }
            //			var_dump($entry);
            $item = get_object_vars($entry);
            $item['url'] = $entry->Url;
            $res[] = $item;
        }
    } else {
        $res[] = 'empty';
    }
    save_bing($like_object['id'], $res, $domain);
    return $res;
}
Esempio n. 2
0
    <h2>round number <?php 
    echo $i;
    ?>
</h2>
    bring results from <?php 
    echo $search_start_from;
    ?>
 to <?php 
    echo $search_limit + $search_start_from;
    ?>
,
    <br>
    <?php 
    ob_flush();
    flush();
    $bingData = getBingData($query, $search_limit, $search_start_from);
    if (!$bingData) {
        echo "<b>Blocked by Bing on: </b>" . $i * 50;
        exit;
    }
    $query_id = set_new_query($query, $search_limit, $search_start_from);
    set_query_tag_relation($query_id, $tag_id);
    save_bing_data($bingData, $query, $query_id, $tag_id);
    ?>
    data saved in MongoDB <br>
    $query_id = <?php 
    echo $query_id;
    ?>
<br>
    <br>
    <hr>