<?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>nightdrops.com &#187; api</title>
	<atom:link href="http://www.nightdrops.com/tag/api/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nightdrops.com</link>
	<description>like the color blue</description>
	<lastBuildDate>Thu, 01 Jul 2010 13:19:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Webservices, simple introduction.</title>
		<link>http://www.nightdrops.com/2009/webservices-simple-introduction/</link>
		<comments>http://www.nightdrops.com/2009/webservices-simple-introduction/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 15:08:44 +0000</pubDate>
		<dc:creator>kajyr</dc:creator>
				<category><![CDATA[Blog posts]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[last.fm]]></category>
		<category><![CDATA[webservices]]></category>

		<guid isPermaLink="false">http://www.nightdrops.com/?p=72</guid>
		<description><![CDATA[Website exposes their data to 3rd part application trought webservices and xml. It&#8217;s pretty simple: the user calls a url which has some parameters that contains the request, the webserver handles the request, queries the database and prints out the resulting data in XML (or JSON, or other) format. This permits to limit user access [...]]]></description>
			<content:encoded><![CDATA[<p>Website exposes their data to 3rd part application trought webservices and xml. It&#8217;s pretty simple: the user calls a url which has some parameters that contains the request, the webserver handles the request, queries the database and prints out the resulting data in XML (or JSON, or other) format. This permits to limit user access to the complete data, exposing only a part of them.</p>
<p>This is the underlying technology that empowers all kinds of mashup: you request data from some sources, combine it and show them up in your application. I want to share some examples of building an app that works with data loaded from external webservices; I&#8217;m not gonna show you another flickr example, there are too many out there, so I&#8217;d prefer doing something using <a href="http://www.lastfm.it/api/intro">Last.fm APIs</a>.</p>
<p>First thing is, you have to <a href="http://www.lastfm.it/api/account">apply for an API KEY</a>. What does this means? Api calls somethines aren&#8217;t free, other times the provider wants to keep track of who calls which api, or keep statistics; So you have register a unique id that will sign all your calls. Usually you pass this key as a parameter of the function.</p>
<p>So to start, let&#8217;s choose a simple function to call, <a href="http://www.lastfm.it/api/show?service=310">artist.getTopFans</a> sounds good and doesn&#8217;t require authentication. It prints out informations about the top fans of a given artist. The documentation page tells that it requires 2 parameters: the artist name, and the api key, they explains themselves.</p>
<p>So now we know that we want to know who are the top fans of.. let&#8217;s say, Cher. We have to take the root url of the APIs, which is</p>
<p> </p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://ws.audioscrobbler.com/2.0/</div></div>
<p> </p>
<p>enqueued by the parameters written as<em> &amp;key=value</em> pairs (It&#8217;s a simple HTTP GET request, other services will require HTTP POST requests, but, later).<br />
We now have the url of the call, which should be similar to:</p>
<p> </p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">http://ws.audioscrobbler.com/2.0/?method=artist.gettopfans&amp;amp;artist=cher&amp;amp;api_key=xxxxxxxxxxxx</div></div>
<p>You can try substituting your api key and open that url in a web browser.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nightdrops.com/2009/webservices-simple-introduction/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The stage property and the display list</title>
		<link>http://www.nightdrops.com/2009/the-stage-property-and-the-display-list/</link>
		<comments>http://www.nightdrops.com/2009/the-stage-property-and-the-display-list/#comments</comments>
		<pubDate>Fri, 09 Jan 2009 10:37:16 +0000</pubDate>
		<dc:creator>kajyr</dc:creator>
				<category><![CDATA[Blog posts]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://www.nightdrops.com/blog/?p=17</guid>
		<description><![CDATA[In Actionscript, the stage object is referenced by the DisplayObject.stage property. I use it alot, for example, to center elements on the screen, but as we read in the api reference, If a display object is not added to the display list, its stage property is set to null. this can be uncomfortable when you want to position something [...]]]></description>
			<content:encoded><![CDATA[<p>In Actionscript, the stage object is referenced by the <a href="http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/display/DisplayObject.html#stage" target="_blank">DisplayObject.stage</a> property. I use it alot, for example, to center elements on the screen, but as we read in the api reference,</p>
<blockquote><p>If a display object is not added to the display list, its stage property is set to null.</p></blockquote>
<p>this can be uncomfortable when you want to position something <em>before</em> attaching it, for any reason, or if you want a control object to operate on some stage property (fullscreen, for example).</p>
<p>So to avoid this, I usually add a static property to my Document Class, let&#8217;s call it staticStage:</p>
<div class="codecolorer-container actionscript3 default" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><br /><strong>GeSHi Error:</strong> GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)<br /></div>
<p>Of course, the stage in FlashExample will not be null, since the DocumentClass is always added to the display list.</p>
<p>With this trick, you always have the stage at hand, by simply referencing <tt>FlashExample.staticStage</tt> anywhere on your code.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nightdrops.com/2009/the-stage-property-and-the-display-list/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Last.fm Actionscript API</title>
		<link>http://www.nightdrops.com/2009/lastfm-actionscript-api/</link>
		<comments>http://www.nightdrops.com/2009/lastfm-actionscript-api/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 10:26:05 +0000</pubDate>
		<dc:creator>kajyr</dc:creator>
				<category><![CDATA[Blog posts]]></category>
		<category><![CDATA[actionscript]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[last.fm]]></category>

		<guid isPermaLink="false">http://www.nightdrops.com/blog/?p=3</guid>
		<description><![CDATA[One of the social networking sites i find most useful is Last.fm; I won&#8217;t go into details, but i&#8217;ve decided to write down Actionscript API to provide a simple access to the Last.fm API. I&#8217;ve just begun and i&#8217;ll consider this an exercise to learn something. The big problem for the moment seems the authentication, [...]]]></description>
			<content:encoded><![CDATA[<p>One of the social networking sites i find most useful is <a href="http://www.last.fm">Last.fm</a>; I won&#8217;t go into details, but i&#8217;ve decided to write down Actionscript API to provide a simple access to the Last.fm API.<br />
I&#8217;ve just begun and i&#8217;ll consider this an exercise to learn something.</p>
<p>The big problem for the moment seems the authentication, i want to came out with something really simple to use, and i don&#8217;t like using evenListeners to fetch replies (i know.. i know.. but..).</p>
<p>So for the moment i&#8217;ve got only a bunch of functions working that don&#8217;t requires auth, like <a href="http://www.lastfm.it/api/show?service=119">artist.getSimilar</a>. See the example.</p>
<p>Ok i&#8217;m so proud this stupid example is my first first flex related thing that i show up to someone! :-)</p>
<p><iframe src="http://www.nightdrops.com/kj-includes/LastFMApi_example_1/SimilarArtistsSImple.html" width="100%" height="300"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nightdrops.com/2009/lastfm-actionscript-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
