Bug Fix - Cache Table Not Being Cleared

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.

Download Image phpYahoo v2.1.0.2 Downloads: 544 times

Posted in phpYahoo, Release, bug | No Comments »

phpYahoo - date_default_timezone_set() error Fixed

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.

Download Image phpYahoo v2.1.0.1 Downloads: 307 times

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 »

Examples Updated

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:

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

Instantiate a new phpYahoo class

PHP:

  1. $y = new phpYahoo('YAHOOAPPID');

Get the search keyword(s) and create an array of parameters

PHP:

  1. $keyword = $_GET['keyword'];
  2. $params = array("query"=>$keyword,"region"=>"us","type"=>"any","results"=>"20");

Call the webSearch function and get the results

PHP:

  1. $results = $y->searchWeb($params);

Loop through the results and assign it to a variable as HTML

PHP:

  1. foreach($results as $result) {
  2. $html .= "<h3><a href='".$result['clickUrl']."' title='".$result['displayUrl']."'>".$result['title']."</a></h3>";
  3. $html .= $result['summary'];
  4. $html .= "<br>";                   
  5. }

Add a FORM to search from

HTML:

  1. <form method="get" class="mainsearch" action="websearch.php">      
  2. <input name="keyword" id='keyword' class="maintextbox" type="text" value="<?php echo $_GET['keyword']; ?>" />
  3. <input name="search" class="mainsearchbutton" value="Search" type="submit" />
  4. </form>

Display the results

PHP:

  1. <?php echo $html;?>

Posted in phpYahoo, Documentation, Source Code, Example | No Comments »

Return Values

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 »

Example Code Usage

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 »

phpYahoo Version 2.1 Released

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 »

phpYahoo Version 2.0 Released

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 »

phpYahoo Updated - Jan 30, 2007

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 »

phpYahoo: An Unofficial Yahoo Search API

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 »