PHP
  Home arrow PHP arrow Page 3 - Using Yahoo Web Services to Perform Se...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Using Yahoo Web Services to Perform Searches with an Object-Oriented Approach
By: Alejandro Gervasio
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2008-02-12

    Table of Contents:
  • Using Yahoo Web Services to Perform Searches with an Object-Oriented Approach
  • Building a web search class with PHP 5
  • Testing the previous “WebSearchService” class
  • Building a video searching class with PHP 5

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Using Yahoo Web Services to Perform Searches with an Object-Oriented Approach - Testing the previous “WebSearchService” class


    (Page 3 of 4 )

    If you’re anything like me, then you may want to see how the previously defined “WebSearchService” class can work under real conditions. Therefore, below I set up a concrete example that shows how the class in question returns 15 different entries associated with the string “Devshed.com” to client code, naturally fetched by the respective Yahoo! Web Search Service.

    Here’s the corresponding code sample, along with the pertinent list of results:


    try{

    // create new instance of 'WebSearchService' class

    $ws=new WebSearchService();

    // set search query

    $ws->setQuery('Devshed.com');

    // set number of search results

    $ws->setNumResults(15);

    // display search results

    echo $ws->getSearchResults();

     

    }

    catch(Exception $e){

    echo $e->getMessage();

    exit();

    }


    // displays the following


    Open Source Web Development Tutorials - Dev Shed


    Offers a complete line of information on web page
    design tips, java scripting guide, shareware HTML
    editor, and web server software and setup.

    http://www.devshed.com/

    Webmaster Tools, Developer Tools, Programming Tools -
    Dev Mechanic


    Do you know who your target audience is? If you don't
    know, you are not ... When faced with diminishing sales
    or a shift in profitability, sometimes a ...

    http://tools.devshed.com/

    Web Hosting, Web Hosting Help, Web Hosting FAQs,
    Find Hosting - Web Hosting


    Web Hosting, Web Hosting Help, Web Hosting FAQs,
    Find Hosting - Web Hosting ... In this second part, I
    want to get more specific about the types of hosting ...

    http://webhosting.devshed.com/

    PHP Help, PHP Programming, PHP Code, PHP Tutorials


    A wide range of tutorials and articles with a growing
    PHP section. ... Formerly referred to as "Personal Home
    Page Tools," PHP Hypertext Preprocessor ...

    http://www.devshed.com/c/b/PHP/

    PHP Security Mistakes


    Email Me Similar Content When Posted. Add Developer
    Shed Article Feed To Your Site. Email Article To Friend.
    Print Version Of Article. PDF Version Of Article ...

    http://www.devshed.com/c/a/PHP/PHP-Security-Mistakes/

    Creating a Secure PHP Login Script


    Email Me Similar Content When Posted. Add Developer
    Shed Article Feed To Your Site. Email Article To Friend. Print
    Version Of Article. PDF Version Of Article ...

    http://www.devshed.com/c/a/PHP/
    Creating-a-Secure-PHP-Login-Script/

    MySQL Help, MySQL Tutorials, MySQL Programming, MySQL
    Tricks


    A collection of MySQL tutorials on Administration, and
    Grant Tables. ... MySQL is an open source relational
    database management system (RDBMS) ...

    http://www.devshed.com/c/b/MySQL/

    Linux Web Hosting


    Find your next Linux Web Host now! Search through
    our highly recommended Linux Web Hosting companies
    and read our Web Hosting FAQs and Web Hosting articles
    to help ...

    http://www.devshed.com/linux-web-hosting

    Perl Help, Perl Programming, Perl Code, Perl Tutorials,
    Perl Development


    A five-part beginning perl series that covers topics from
    regular expressions to file manipulation to database
    access for web developers.

    http://www.devshed.com/c/b/Perl/

    Dedicated Servers


    Find your next Dedicated Servers Host now! Search
    through our highly recommended Dedicated Servers
    Hosting companies and read our Web Hosting FAQs
    and Web Hosting ...

    http://www.devshed.com/dedicated-servers

    Small Business Hosting


    Find your next Small Business Host now! Search through
    our highly recommended Small Business Hosting companies
    and read our Web Hosting FAQs and Web Hosting articles ...

    http://www.devshed.com/small-business-hosting

    Web Development Archives, Web Developer Archives, FAQs,
    Mailing Lists, Newsgroups


    Web Development archives, containing a multitude of
    information spanning FAQs, ... Here you will find an
    assortment of Mailing Lists such as Java Discussion,
    MySQL ...

    http://archives.devshed.com/

    E-Commerce Hosting


    Find your next E-commerce Web Host now! Search through
    our highly recommended E-commerce Web Hosting companies
    and read our Web Hosting FAQs and Web Hosting articles ...

    http://www.devshed.com/e-commerce-hosting

    High Performance Web Caching With Squid


    Article on tuning Squid on Linux for maximum performance
    and stability. ... Email Me Similar Content When Posted. Add
    Developer Shed Article Feed To Your Site ...

    http://www.devshed.com/c/a/Administration/High-
    Performance-Web-Caching-With-Squid/

    Database Programming in Python: Accessing MySQL


    Database Programming in Python: Accessing MySQL by
    A.P.Rajshekhar ... Email Me Similar Content When Posted.
    Add Developer Shed Article Feed To Your Site ...

    http://www.devshed.com/c/a/Python/
    Database-Programming-in-Python-Accessing-MySQL/


    See how easy it is to query the Yahoo! Web Search Service using the PHP class that I built before? I guess you do! In this case, this class comes in handy for hiding all the business logic required to implement this specific Yahoo! web service behind its API, and its use demands only a few lines of PHP 5 code.

    All in all, I showed you how to use a compact PHP class to query the Yahoo! Web Search Service and eventually return the corresponding results to client code. So, what is the next thing to do now?

    Well, due to the flexible nature of the class that you learned before, it’s possible to build a similar one that works with the Yahoo! Video Search Service instead, without having to completely modify its structure. Therefore, in the last section of this tutorial I’m going to show you how to build such a class. But as you might have guessed, to see the details of this process, you’ll have to click on the link below and keep reading.

    More PHP Articles
    More By Alejandro Gervasio


       · Over the course of this fifth chapter of the series, you’ll be provided with the...
     

       

    PHP ARTICLES

    - Viewing and Editing Tasks for a Project Mana...
    - More on Private Methods with PHP 5 Member Vi...
    - Adding Tasks to a Project Management Applica...
    - Utilizing Private Methods with PHP 5 and Mem...
    - Making Changes in a Project Management Appli...
    - Defining Public and Protected Methods with M...
    - HTML for a Project Management Application
    - Using Subclasses and Accessors with Member V...
    - Implementing Internet Protocols with PHP
    - Project Management: The Application
    - Working with Private Properties to Protect P...
    - Protecting PHP 5 Class Data with Member Visi...
    - Setting Up a Web-based Image Hosting Service
    - Comparing Files and Databases with PHP Bench...
    - Setting Up a Web-Based Image Gallery





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway