March 1st, 2007 by
jay
I found a bug yesterday with the cache table not being cleared out.
The problem was with the SQL that counts the row and then checks to see whats out of date and if the table has reached it limit.
I have fixed this issue and updated the base library.
Posted in phpYahoo, Release, bug |
No Comments »
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 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 »
January 30th, 2007 by
jay
I have updated the phpYahoo base class to include caching using PDO as well as expanding the search to allow either a search term or phrase or an array of parameters.
I have also created a Yahoo! Gallery Page as well as a Google Project Page
The Google Project Page has the source code, instructions and other useful information.
Posted in phpYahoo |
No Comments »
January 30th, 2007 by
jay
*updated - 2007-01-26*
phpYahoo is a class written in PHP5 that act's as a wrapper for Yahoo's! Web Search API. Methods process the response XML and return an array of data to make development easier. With this class you can search for Yahoo! Web content, Yahoo! Videos or Yahoo! Images.
This class follows a similar pattern like phpNapster class.
Read the rest of this entry »
Posted in phpYahoo |
No Comments »