<?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>crossedstreams.com &#187; web services</title>
	<atom:link href="http://blog.crossedstreams.com/category/web-services/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.crossedstreams.com</link>
	<description>Total protonic reversal!</description>
	<lastBuildDate>Sat, 21 Jan 2012 20:10:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Getting Started with Web Services</title>
		<link>http://blog.crossedstreams.com/development/getting-started-with-web-services/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-web-services</link>
		<comments>http://blog.crossedstreams.com/development/getting-started-with-web-services/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 16:30:36 +0000</pubDate>
		<dc:creator>Paul Brabban</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://blog.crossedstreams.com/?p=106</guid>
		<description><![CDATA[You may not know this, but all you need to get started using web services is a web browser. You might have never heard of web services, or assumed it&#8217;s too complicated, or maybe you tried it before but had a painful experience &#8211; it&#8217;s always possible for poor design or implementation to make simple [...]]]></description>
			<content:encoded><![CDATA[<p>You may not know this, but all you need to get started using web services is a web browser. You might have never heard of web services, or assumed it&#8217;s too complicated, or maybe you tried it before but had a painful experience &#8211; it&#8217;s always possible for poor design or implementation to make simple things difficult.</p>
<p>Well, consuming half-decent web services isn&#8217;t necessarily difficult. Bear with me for the next 30 seconds of your life and I&#8217;ll show you some examples of easy, useful web services APIs.</p>
<p>It&#8217;s also probably worth noting that different browsers can behave differently, and I&#8217;ve done this stuff in Firefox 3. If the links below don&#8217;t work, copy-pasting the link into your browser address bar and hitting return should do the trick.</p>
<h2>The Google Maps API</h2>
<p>You can use the Google Maps API to turn a postcode into a latitude and longitude. Try it with this link.</p>
<p><a href="http://maps.google.com/maps/geo?q=S51AB+uk&amp;output=csv&amp;key=ABQIAAAA4UhPgpz07YqQJUp1y5IaIhRtTVReFW3l-gAiTqQ74Mw8SB71yBQOFJhmCnfn5hdxeylS5sXou5mUow">http://maps.google.com/maps/geo?q=S51AB+uk&amp;output=csv</a></p>
<p>Output in your browser:</p>
<pre>200,5,53.4332097,-1.4436139</pre>
<p>The first and second numbers are related to the query, the second two are the latitude and longitude of the UK postcode &#8216;S5 1AB&#8217;. You can change the postcode and country in your browser address bar &#8211; hit return to submit the new address details.</p>
<p>It&#8217;s a neat example, because it&#8217;s a very simple query and response.</p>
<h2>Yahoo Finance</h2>
<p>Now, let&#8217;s check the stock portfolio.</p>
<p><a href="http://quote.yahoo.com/d/quotes.csv?s=MSFT&amp;f=sl">http://quote.yahoo.com/d/quotes.csv?s=MSFT&amp;f=sl</a></p>
<p>The output of this one comes back as a Comma Separated Values document, same as the Google Maps example, but it is set up to save the values into a file instead of displaying it on your browser. If you open the file:</p>
<pre>"MSFT",23.692,"8/14/2009","4:00pm",+0.072,23.62,23.80,23.51,46331960</pre>
<p>So the stock price for Microsoft Corporation was 23.692 at Friday&#8217;s close.</p>
<h2>Twitter</h2>
<p>Next up, twitter. If you&#8217;ve never heard of twitter, welcome to Earth. Let&#8217;s grab my public timeline.</p>
<p><a href="http://twitter.com/statuses/user_timeline/brabster.xml">http://twitter.com/statuses/user_timeline/brabster.xml</a></p>
<p>The output this time is a little more funky &#8211; because what we&#8217;ve just requested is much more complex than just a latitude and longitude. You&#8217;ll get an XML document back, which is a machine-friendly way of storing complex data. Not so nice for people to look at though, but hey.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;statuses</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;array&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;status<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;created_at<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Tue Sep 01 19:07:07 +0000 2009<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/created_at<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>3694475261<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/id<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>@cazm: hate that - if I don't know how come something's fixed I worry about when it's gonna break next!<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/text<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><span style="color: #ddbb00;">&amp;lt;</span>a href=<span style="color: #ddbb00;">&amp;quot;</span>http://sourceforge.net/projects/twitux<span style="color: #ddbb00;">&amp;quot;</span> rel=<span style="color: #ddbb00;">&amp;quot;</span>nofollow<span style="color: #ddbb00;">&amp;quot;&amp;gt;</span>twitux<span style="color: #ddbb00;">&amp;lt;</span>/a<span style="color: #ddbb00;">&amp;gt;</span><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/source<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;truncated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/truncated<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  ...</pre></div></div>

<h2>Summary</h2>
<p>Mixing and matching the functionality this stuff exposes creates <a href="http://en.wikipedia.org/wiki/Mashup_(web_application_hybrid)">mashups</a>.</p>
<p>Whilst a browser provides a really easy way for us to explore these services, the trick is that it&#8217;s easy to write software that invokes services like these and then uses the information in the response, in fact in many languages invoking a service like those above and capturing the response can be done in a single short line of code.</p>
<p>Often, traditional websites that produce nicely human-readable, formatted pages like this one are actually working with APIs like those above behind the scenes.</p>
<p>There&#8217;s a whole world of web services APIs out there to play with, for free &#8211; and more are coming along all the time.</p>
<p>(Note &#8211; these examples will almost certainly break, given enough time, as the services evolve. If you try one and it doesn&#8217;t work, please leave me a comment and I&#8217;ll get it fixed.)</p>
<div class="disclaimer">These are my thoughts and opinions and do not reflect
those of anyone else. Read the <a href="disclaimer">disclaimer</a> for more verbal
teflon.</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.crossedstreams.com/development/getting-started-with-web-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

