<?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>Stephen Dettling</title>
	<atom:link href="http://sdettling.com/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://sdettling.com/blog</link>
	<description>Web developer, lighting designer and photographer from New York City.</description>
	<lastBuildDate>Tue, 14 Jun 2011 21:47:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
		<item>
		<title>Getting Started with the Flickr API</title>
		<link>http://sdettling.com/blog/2011/06/getting-started-with-the-flickr-api/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=getting-started-with-the-flickr-api</link>
		<comments>http://sdettling.com/blog/2011/06/getting-started-with-the-flickr-api/#comments</comments>
		<pubDate>Tue, 14 Jun 2011 17:00:02 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Flickr]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[json]]></category>

		<guid isPermaLink="false">http://sdettling.com/blog/?p=33</guid>
		<description><![CDATA[Here&#8217;s a quick post on a simple way to get data from Flickr&#8217;s API using jQuery. $.getJSON&#40;&#34;http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&#38;amp;api_key=[[your api key]]&#38;amp;photoset_id=[[your photoset id]]&#38;amp;format=json&#38;amp;jsoncallback=?&#34;, function&#40;data&#41; &#123; console.log&#40;data&#41;; //prints the data object to the console in a web developer tool like firebug &#41;; &#125;&#41;; First you will need to obtain an api key which you can apply for here. [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick post on a simple way to get data from <a href="http://www.flickr.com/services/api/" target="_blank">Flickr&#8217;s API</a> using <a href="http://jquery.com/">jQuery</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">getJSON</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;http://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&amp;amp;api_key=[[your api key]]&amp;amp;photoset_id=[[your photoset id]]&amp;amp;format=json&amp;amp;jsoncallback=?&quot;</span><span style="color: #339933;">,</span>
	<span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>data<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #006600; font-style: italic;">//prints the data object to the console in a web developer tool like firebug</span>
	<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><span id="more-33"></span>First you will need to obtain an api key which you can apply for <a href="http://www.flickr.com/services/apps/create/apply/" target="_blank">here</a>. With your key you can start making calls to the api. In the example above I make a rest request for the contents of a photoset.</p>
<p>I use jQuery&#8217;s <a href="http://api.jquery.com/jQuery.getJSON/" target="_blank">getJSON</a> method to make the ajax call. This method allows us to communicate with Flickr&#8217;s third party domain and automatically captures the json response we have requested. Let&#8217;s take a closer look at the URL for the request:</p>
<p>http://api.flickr.com/services/<span style="color: #000000;">rest</span>/?method=<span style="color: #ff0000;">flickr.photosets.getPhotos</span>&amp;api_key=<span style="color: #333399;">[[your api key]]</span>&amp;photoset_id=<span style="color: #339966;">[[your photoset id]]</span>&amp;format=json&amp;jsoncallback=?</p>
<ol>
<li><span style="color: #ff0000;">flickr.photosets.getPhotos</span>: This is the api method we are requesting, additional methods can be found in <a href="http://www.flickr.com/services/api/" target="_blank">flickr&#8217;s api documentation</a>. With this particular method I am requesting the contents of a specific photoset.</li>
<li><span style="color: #333399;">api key</span>: Change this to your api key.</li>
<li><span style="color: #339966;">photoset ID</span>: Change this to the ID of the photoset you want the contents of. To find a photoset ID look at the url when browsing photosets on flickr. When using other api methods you will need to pass different attributes and values in this part of the url.</li>
</ol>
<p>The resulting &#8216;data&#8217; variable contains the json object returned by the ajax request. In this example I am printing the object to the console so I can see what variables are available to me. To learn more about the using the console check out my <a title="Debugging Javascript with Console.Log and Firebug Instead of Alerts" href="http://sdettling.com/blog/2011/05/debugging-javascript-with-console-log-and-firebug-instead-of-alerts/" target="_blank">previous post</a>. Provided you have experience with javascript objects you can continue developing your web application using this json data.</p>
]]></content:encoded>
			<wfw:commentRss>http://sdettling.com/blog/2011/06/getting-started-with-the-flickr-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging Javascript with Console.Log and Firebug Instead of Alerts</title>
		<link>http://sdettling.com/blog/2011/05/debugging-javascript-with-console-log-and-firebug-instead-of-alerts/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=debugging-javascript-with-console-log-and-firebug-instead-of-alerts</link>
		<comments>http://sdettling.com/blog/2011/05/debugging-javascript-with-console-log-and-firebug-instead-of-alerts/#comments</comments>
		<pubDate>Wed, 04 May 2011 20:12:52 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[debugging]]></category>
		<category><![CDATA[firebug]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://sdettling.com/blog/?p=54</guid>
		<description><![CDATA[JavaScript (js) is a powerful programming language that allows web developers to do some interesting things on their webpages including: manipulate and animate HTML content, load data asynchronously, and to create more compelling user interfaces. JS has become much more relevant in the past few years with the proliferation of web enabled mobile devices, and [...]]]></description>
			<content:encoded><![CDATA[<p>JavaScript (js) is a powerful programming language that allows web developers to do some interesting things on their webpages including: manipulate and animate HTML content, load data asynchronously, and to create more compelling user interfaces. JS has become much more relevant in the past few years with the proliferation of web enabled mobile devices, and the introduction of AJAX. The language continues to become more accessible as libraries like <a href="http://jquery.com">jQuery</a> make complex concepts easy.<span id="more-54"></span></p>
<p>An important aspect of any programming language is the ability to debug problems that arise during the development process. A popular way to debug problems in any language is to print messages that describe what is happening in a certain troublesome part of your code. You could print the value of a variable after a calculation is made for example.</p>
<p>For many years my primary way of printing these insightful messages was using a standard js alert. It got the job done but has several drawbacks including: disabling all interaction with the browser until the message is dismissed, only capable of printing strings, detrimental user experience if visible to end-users, and potentially hazardous if placed in an infinite loop.</p>
<p>Luckily there is a much more elegant way to achieve this functionality if you&#8217;re debugging your front-end code with the <a href="http://getfirebug.com/">Firebug</a> extension for <a href="http://www.mozilla.com/firefox">Firefox</a> (as well as other web developer tools such as those built into some webkit browsers like <a href="http://www.google.com/chrome/">Chrome</a>). Take the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> myVariable <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Hello World!&quot;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>myVariable<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>The variable you passed via console.log should appear in the console panel of Firebug:</p>
<div><img class="alignnone size-full wp-image-61" title="firebug console.log hello world" src="http://sdettling.com/blog/wp-content/uploads/2011/05/console.log_.hello_.jpg" alt="" width="625" height="100" /></div>
<p>This method overcomes many of the drawbacks of using alerts. These messages are not seen by end-users, they don&#8217;t cripple the page by interrupting the execution of your script, and they can print complex variables like arrays and objects. Here is an example of using console.log with a json object:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> desserts <span style="color: #339933;">=</span> <span style="color: #009900;">&#91;</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;pies&quot;</span><span style="color: #339933;">,</span>
    <span style="color: #3366CC;">&quot;items&quot;</span><span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>
      <span style="color: #3366CC;">&quot;pumpkin&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;apple&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;cherry&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;pecan&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;lemon meringue&quot;</span>
    <span style="color: #009900;">&#93;</span>
  <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span>
  <span style="color: #009900;">&#123;</span>
    <span style="color: #3366CC;">&quot;type&quot;</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">&quot;cakes&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;items&quot;</span><span style="color: #339933;">:</span>
    <span style="color: #009900;">&#91;</span>
      <span style="color: #3366CC;">&quot;red velvet&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;chocolate&quot;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">&quot;carrot&quot;</span>
    <span style="color: #009900;">&#93;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
console.<span style="color: #660066;">log</span><span style="color: #009900;">&#40;</span>desserts<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If you were to alert this variable the string returned would only tell you what type of variable it is. The console panel will give you a full representation of the contents of the variable.</p>
<div><img class="alignnone size-full wp-image-61" title="firebug console.log object" src="http://sdettling.com/blog/wp-content/uploads/2011/05/console.log_.object.jpg" alt="" width="625" height="100" /></div>
<p>For complex variables like this one you can click on a specific portion of the element to explore it&#8217;s values in the DOM panel.</p>
<div><img class="alignnone size-full wp-image-72" title="console.log.dom" src="http://sdettling.com/blog/wp-content/uploads/2011/05/console.log_.dom_.jpg" alt="" width="625" height="177" /></div>
<p>Despite the advantages, there are some caveats to this method as well. It only works with Firebug so it doesn&#8217;t help when troubleshooting browser specific issues. It also has the potential to cause js errors in specific browsers like IE so be sure to remove your debug code before deploying your code. When used responsibly console.log can prove to be quite powerful for debugging scripts.</p>
]]></content:encoded>
			<wfw:commentRss>http://sdettling.com/blog/2011/05/debugging-javascript-with-console-log-and-firebug-instead-of-alerts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What Happened to Facebook&#8217;s Static FBML Application?</title>
		<link>http://sdettling.com/blog/2011/04/what-happened-to-facebooks-static-fbml-application/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=what-happened-to-facebooks-static-fbml-application</link>
		<comments>http://sdettling.com/blog/2011/04/what-happened-to-facebooks-static-fbml-application/#comments</comments>
		<pubDate>Thu, 28 Apr 2011 21:20:30 +0000</pubDate>
		<dc:creator>Stephen</dc:creator>
				<category><![CDATA[Facebook]]></category>
		<category><![CDATA[facebook]]></category>
		<category><![CDATA[facebook pages]]></category>
		<category><![CDATA[fbml]]></category>
		<category><![CDATA[iframe]]></category>

		<guid isPermaLink="false">http://sdettling.com/blog/?p=36</guid>
		<description><![CDATA[Prior to the most recent update to Facebook Pages I used an application called &#8220;Static FBML&#8221; to create custom promotional &#8220;tabs&#8221; on many of my client&#8217;s Facebook Pages. After Facebook migrated to the new page design I found that this old standby application remained on my existing pages but I could not add it to [...]]]></description>
			<content:encoded><![CDATA[<p>Prior to the most recent update to Facebook Pages I used an application called &#8220;Static FBML&#8221; to create custom promotional &#8220;tabs&#8221; on many of my client&#8217;s Facebook Pages. After Facebook migrated to the new page design I found that this old standby application remained on my existing pages but I could not add it to any new pages I had created. After much searching I found some special links that you can use to get some of those old Static FBML apps into your page:<span id="more-36"></span></p>
<p><a href="http://www.facebook.com/add.php?api_key=fdfd01c9df7d644a68a4e989ae861e44&amp;pages=1&amp;page=102938863123295" target="_blank">Static FBML 1</a><br />
<a href="http://www.facebook.com/add.php?api_key=0985a6f69c916b303dc0641527e4d78a&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 2</a><br />
<a href="http://www.facebook.com/add.php?api_key=4388c0c374edd1e6614cb63e3ddcfc72&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 3</a><br />
<a href="http://www.facebook.com/add.php?api_key=cfe034c961c518a2f1f30211491cf564&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 4</a><br />
<a href="http://www.facebook.com/add.php?api_key=664f406ac4b8414d4342a54bce9144c5&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 5</a><br />
<a href="http://www.facebook.com/add.php?api_key=c6e408f4ee52a337d8517cc1a30c1671&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 6</a><br />
<a href="http://www.facebook.com/add.php?api_key=efe45acd19c56415d918d4a4afb74e72&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 7</a><br />
<a href="http://www.facebook.com/add.php?api_key=0ac2d41cadc9aa04de9691384825412a&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 8</a><br />
<a href="http://www.facebook.com/add.php?api_key=b58e3691fc6a6da377187cc6afd46d2f&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 9</a><br />
<a href="http://www.facebook.com/add.php?api_key=d2182fe10890bbfe8002bbdb6b6954ab&amp;pages&amp;page=143531115712639" target="_blank">Static FBML 10</a></p>
<p>Technically this method of creating custom content on Facebook Pages is no longer supported, but if you&#8217;re in a pinch and looking for a way to get this familiar app to work these links should do the trick.</p>
<p>To learn more about why this app is being phased out and the &#8220;right&#8221; way to create custom content on the new Facebook Pages check out their blog post on the new <a href="https://developers.facebook.com/blog/post/462">iframe Tabs</a>. I&#8217;ll cover methods for creating simple promotions on Facebook pages in an upcoming post.</p>
]]></content:encoded>
			<wfw:commentRss>http://sdettling.com/blog/2011/04/what-happened-to-facebooks-static-fbml-application/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

