Yahoo! Developer Network Blog
« Previous | Main | Next »
February 22, 2006
Yahoo! Releases Web Services Returning Serialized PHP and PHP Developer Center
Today we're launching our new PHP Developer Center and announcing that many of our web services now return serialized PHP. PHP developers will now be able to consume these web services even more easily than before.
Yahoo!'s Search, Maps, and Travel REST web services now return serialized PHP by simply adding the output=php parameter to any web services request.
For example, suppose you want to search for PHP-related podcasts and return the first five results using our Podcast Search service:
http://api.search.yahoo.com/AudioSearchService/ V1/podcastSearchappid=YahooDemo&query=PHP& results=5&output=php
The request above returns the results as serialized PHP. A simple PHP script can trivially parse the request using PHP's unserialize function which is built-in to all PHP4 and PHP5 implementations:
<?php
$request='http://api.search.yahoo.com/ AudioSearchService/V1/podcastSearch?appid=YahooDemo& query=PHP&results=5&output=php';
$result = file_get_contents($request);
$phparray = unserialize($result);
echo '<pre>';
print_r($phparray);
echo '</pre>';
?>
Or, perhaps you'd like to see a list of public trips to Australia using Yahoo!'s Travel web service:
<?php
$request='http://api.travel.yahoo.com/TripService/ V1/tripSearch?appid=YahooDemo& query=australia&results=10&output=php';
$result = file_get_contents($request);
$phparray = unserialize($result);
echo '<pre>';
print_r($phparray);
echo '</pre>';
?>
With this release, we're continuing to push out the standards for developer-friendliness with our web services offerings. For more information, and a complete list of Yahoo! developer APIs, check out the Yahoo! Developer Network web site.
Posted at February 22, 2006 1:48 PM
Comments
Outstanding work, and I can't wait to play with the new toys.
Posted by: John Cox at February 22, 2006 4:04 PM
wow excellent... cool to see so many new yahoo api's coming out so fast..
Posted by: saurab at February 23, 2006 3:07 PM
For anyone who's interested, there's also an implementation of PHPs unserialize() function for Javascript, available here:
Posted by: Richard Heyes at February 26, 2006 8:47 AM
Hm... I don't now!
Posted by: Koly at March 2, 2006 7:37 AM
Subscribe
Recent Blog Articles
view all
The state of mobile browsers - PPK in London
Thu, 02 Jul 2009
GeoMaker - Turning web content into maps made easy
Wed, 01 Jul 2009
Tue, 30 Jun 2009
Hacking Up North : Winners of the Sunderland Hack Challenge
Fri, 26 Jun 2009
ConvergeSC web event comes to South Carolina
Wed, 24 Jun 2009
Recent Links
Junta42 blog: News Flash: Guardian Seeks to Grow through Products, Not Content
Fri, 03 Jul 2009
Twitter Approval Matrix - June 2009 - O'Reilly Radar
Thu, 02 Jul 2009
YUI 3.0 with Jonathan LeBlanc from the Yahoo Developer Network | Unmatched Style
Wed, 01 Jul 2009
Yahoo! Search Blog: VoCampers Converge at Yahoo! Headquarters in Sunnyvale
Thu, 25 Jun 2009
Make: Online : Dorkbot London June 23
Mon, 22 Jun 2009
Archives
2009
2008
2007
2006
2005

