Yahoo BOSS Question

Posted by Fincha on Stack Overflow See other posts from Stack Overflow or by Fincha
Published on 2010-03-28T10:07:44Z Indexed on 2010/03/28 10:13 UTC
Read the original article Hit count: 352

Filed under:
|
|

Hello everyone,

I wonna to echo totalresults but somethink is wrong.

// Get search results from Yahoo BOSS as an XML*
   $API = 'http://boss.yahooapis.com/ysearch/web/v1/';
$request = $API . $query .'?format=xml&appid='. APP_ID.'&start='.$start."0"; 

        $ch = curl_init($request);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        $xml = simplexml_load_string(curl_exec($ch));
        echo $xml->resultset_web->totalhits;
        // Display search results - Title, Date and URL.
        foreach ($xml->resultset_web->result as $result) {

            $ausgabe .= '<a href="'.$result->clickurl.'">'.$result->title.'</a><br />';
            $ausgabe .= $result->abstract."<br>";
            $ausgabe .= '<a href="'.$result->clickurl.'">'.$result->url."</a> - ".round(($result->size/1024), 2)." Kb<br><br>";

        }

Can someone help me

© Stack Overflow or respective owner

Related posts about yahoo

Related posts about php