February 26th, 2007 by
jay
Recently the cache methods started getting uppity about the date_default_timezone_set() not being set. I have fixed this and have updated the phpYahoo class.
date() [function.date]: It is not safe to rely on the system’s timezone settings. Please use the date.timezone setting, the TZ environment variable or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘America/Los_Angeles’ for ‘PST/-8.0/no DST’ instead
Posted in phpYahoo, Release, bug |
No Comments »
February 21st, 2007 by
jay
I have added example code to the web search, video search and the image search.
If you look at the code for each example you'll see that they all share a common structure:
Include the phpYahoo.php file
PHP:
-
include_once('api/phpYahoo.php');
Instantiate a new phpYahoo class
PHP:
-
$y = new phpYahoo('YAHOOAPPID');
Get the search keyword(s) and create an array of parameters
PHP:
-
$keyword = $_GET['keyword'];
-
$params =
array("query"=>
$keyword,
"region"=>
"us",
"type"=>
"any",
"results"=>
"20");
Call the webSearch function and get the results
PHP:
-
$results = $y->searchWeb($params);
Loop through the results and assign it to a variable as HTML
PHP:
-
foreach($results as $result) {
-
$html .= "<h3><a href='".$result['clickUrl']."' title='".$result['displayUrl']."'>".$result['title']."</a></h3>";
-
$html .= $result['summary'];
-
$html .= "<br>";
-
}
Add a FORM to search from
HTML:
-
<form method="get" class="mainsearch" action="websearch.php">
-
<input name="keyword" id='keyword' class="maintextbox" type="text" value="<?php echo $_GET['keyword']; ?>" />
-
<input name="search" class="mainsearchbutton" value="Search" type="submit" />
-
</form>
Display the results
Posted in phpYahoo, Documentation, Source Code, Example |
No Comments »
February 6th, 2007 by
jay
This page explains what is in the return package of the search services: When the results are returned that are in the form of an indexed array of associative arrays. Each array can be accessed by the zero based index number in a for loop or through a foreach loop:
Read the rest of this entry »
Posted in Documentation |
No Comments »
February 6th, 2007 by
jay
Example Usage
Here are 3 examples of using phpYahoo to search for the Web, Videos and Images.
Read the rest of this entry »
Posted in Documentation |
No Comments »
February 6th, 2007 by
jay
This is a minor release that includes the ability to search Yahoo! News.
Download it here.
Posted in phpYahoo, Download, Release |
No Comments »
February 2nd, 2007 by
jay
Ok for those following this project I must apologize for the erratic releases and versions.
Starting today Feb 2, 2007 phpYahoo is at a milestone of version 2.0.
This version contains one single class and each of the Yahoo! Services is a method. This borrows heavily from the phpFlickr Class by Dan Coulter where he built a single class for all of the Flicker functions.
Whereas I at one point thought it would be smart to create a base class that hold utility functions for Yahoo and then a separate class for each of the Yahoo Services like Site Explorer, Web Searching, Audio Searching and so on. So what's wrong with that? Well when it came time to build demos it became very unclear on what class need to be added and to which instance you needed to add your Yahoo AppID.
Read the rest of this entry »
Posted in phpYahoo, Documentation, Release |
No Comments »