My favorites | Sign in
Project Logo
                
Search
for
Updated Feb 01, 2007 by gotfoo
Labels: Featured, Phase-Deploy
CodeUsage  

# phpYahoo: Code Usage

Introduction

Example Usage

Below are a few examples for using phpYahoo.

Details

http://phpyahoo.gotfoo.org/

Invoking the phpYahoo Class

include_once('api/phpYahoo.php'); include_once('api/phpYahooSearch.php');

$ysearch = new phpYahooSearch('jrrxraqsrfgviny'); $ysearch->enableCache('db');

$searchtext= $GET'searchtext';

Yahoo! Web Search

` $params = array("query"=>$keyword,"region"=>"us","type"=>"any","results"=>"20","start"=>$start); $results_web = $y->searchWeb($params); //search text and number of results MAX:50

foreach($results_web as $result) {

$html_web .= "

\n";

//display a link to the search item result
$html_web .= ""; $html_web .= "
";
//display the summary
$html_web .= $result'summary'; $html_web .= "
"; $html_web .= "

Unknown end tag for </p>

\n"; $count++;
} echo $html_web; `

Yahoo! Video Search $params = array("query"=>$keyword,"region"=>"us","type"=>"any","results"=>"20","start"=>$start); $results_web = $y->searchVideos($params);

foreach($results_video as $result) {

$html_video .= "

\n"; $html_video .= ""; $html_video .= "
"; $html_video .= $result'summary'; $html_video .= "
";

//display a thumbnail of the video with a link
$html_video .= ""; $html_video .= "
"; $html_video .= "

Unknown end tag for </p>

\n";

} echo $html_video ;

Yahoo! Image Search $params = array("query"=>$keyword,"region"=>"us","type"=>"any","results"=>"20","start"=>$start); $results_images = $y->searchImages($params);

OR

$results_images = $y->searchImages($searchtext); $html_images .= "

\n"; $html_images .= "

\n"; $i=0; foreach($results_images as $result) {
$html_images .= "
"; $i=0; } } $html_images .= "

Unknown end tag for </table>

Unknown end tag for </p>

\n";

echo $html_images;

\n"; $html_images .= ""; $html_images .= "
";
$html_images .= "

Unknown end tag for </td>

\n"; $i++; if($i==3) {
$html_images .= "

Unknown end tag for </tr>


Sign in to add a comment
Hosted by Google Code