<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Carbon Silk &#187; webservices</title>
	<atom:link href="http://www.carbonsilk.com/tag/webservices/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.carbonsilk.com</link>
	<description>Developing Ideas by James Broad</description>
	<lastBuildDate>Tue, 08 Jan 2013 00:00:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.2</generator>
		<item>
		<title>Using YQL with PHP</title>
		<link>http://www.carbonsilk.com/development/using-yql-with-php/</link>
		<comments>http://www.carbonsilk.com/development/using-yql-with-php/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 23:18:35 +0000</pubDate>
		<dc:creator>James Broad</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[webservices]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.carbonsilk.com/?p=70</guid>
		<description><![CDATA[After presenting on PHP, OAuth and Web Services (4th February 2009) it became apparent that the main killer technology was YQL. YQL for those unfamiliar with the acronym is Yahoo Query Language, a SQL like syntax that will let you query a whole host of data sources as if it were a database table. Is [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://developer.yahoo.com/yql/"><img src="http://l.yimg.com/a/i/us/pps/yql128.gif" alt="YQL Logo" /></a>After presenting on <a href="http://www.slideshare.net/kulor/php-oauth-web-services-and-yql">PHP, OAuth and Web Services</a> (4th February 2009) it became apparent that the main killer technology was <a href="http://developer.yahoo.com/yql/"><acronym title="Yahoo Query Language">YQL</acronym></a>. YQL for those unfamiliar with the acronym is Yahoo Query Language, a <acronym title="Simple Query Language">SQL</acronym> like syntax that will let you query a whole host of data sources as if it were a database table.</p>
<p>Is YQL relevant to you? Well if you do any work with web services then definitely, it allows you to pull in multiple data sources, sort, transform, query your data points, to name but a few selling points. It will still be relevant to you if you are familiar with the SQL syntax, as it is actually really fun to play with <a href="http://developer.yahoo.com/yql/console/">using the console</a>, especially if you take the provided example queries as a jump off point to tinker with. To demonstrate how easy we can make things, take a look at this <a href="http://carbonsilk.com/yql_php/yql/search_yahoo/yql">example of a search query</a> using <a href="http://github.com/kulor/yql_php/blob/da559e966663a519f436d0aa9944212582806b98/system/application/controllers/yql.php#L65">this code</a>.</p>
<p>YQL is now becoming even more powerful with a feature called &#8216;Open Tables&#8217; which in essence instructs YQL on how to construct a web service URL. The power of this is that it enables you to interject values from other web service calls via sub selects. Some examples of Open Table definitions and <a href="http://github.com/spullara/yql-tables/blob/dea6b29ff0cd01e06fbaf84b821abf6783138b52/alltables.env">example queries</a> are being constructed at <a href="http://github.com/spullara/yql-tables/">github.com/spullara/yql-tables</a>.</p>
<p>During my talk I demonstrated a lot of the PHP code used to consume the results of the YQL calls which can be found over on <a href="http://github.com/kulor/yql_php/tree/master">my GitHub repository</a> or you can browse my example scripts at <a href="http://carbonsilk.com/yql_php/">http://carbonsilk.com/yql_php/</a>.</p>
<p>To make development in PHP straightforward I used CodeIgniter for it&#8217;s MVC strengths and ease of installation. The beauty of using the framework with YQL and OAuth libraries doing the hard work behind the scenes is that you can write a few simple lines like the following to retrieve instant results:</p>
<pre name="code" class="php">
// Controller method to allow us to access http://someurl.tld/yql_php/search_wikipedia/
function search_wikipedia($term = 'open')
{
    echo '&lt;pre&gt;';
    $yql_query = 'select * from xml where
            url="http://en.wikipedia.org/w/api.php?action=opensearch&amp;search=' . $term . '&amp;format=xml"
            and itemPath = "SearchSuggestion.Section.Item"';
    print_r($this-&gt;yql_lib-&gt;query($yql_query));
}</pre>
<p>The above code is the same query as could be found if you <a href="http://developer.yahoo.com/yql/console/?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fen.wikipedia.org%2Fw%2Fapi.php%3Faction%3Dopensearch%26search%3Dyahoo%26format%3Dxml%22%20and%20itemPath%20%3D%20%22SearchSuggestion.Section.Item%22">view in the provided console</a> or view in my final project <a href="http://carbonsilk.com/yql_php/yql/search_wikipedia/open">Search Wikipedia through YQL</a>.</p>
<p>All I can say from doing this talk and looking deep into YQL is that there is a huge potential at our disposal here.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.carbonsilk.com/development/using-yql-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
