<?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>Backdrifter &#187; php</title>
	<atom:link href="http://www.backdrifter.com/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.backdrifter.com</link>
	<description>The personal site of Jared Hanson</description>
	<lastBuildDate>Fri, 02 Sep 2011 03:49:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Online Status Indicators with Ajax</title>
		<link>http://www.backdrifter.com/2010/01/24/online-status-indicators-with-ajax/</link>
		<comments>http://www.backdrifter.com/2010/01/24/online-status-indicators-with-ajax/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 05:51:11 +0000</pubDate>
		<dc:creator>Jared Hanson</dc:creator>
				<category><![CDATA[Unknown]]></category>
		<category><![CDATA[aim]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[im]]></category>
		<category><![CDATA[msn]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[skype]]></category>
		<category><![CDATA[yahoo]]></category>

		<guid isPermaLink="false">http://www.backdrifter.com/?p=172</guid>
		<description><![CDATA[Back in October, Tantek Çelik wrote an entry on the Microformats blog, featuring my online identity, jaredhanson.net, as an example of a beautifully styled hCard.
While I don&#8217;t claim to be particularly adept at web design, especially compared to the other two featured individuals (Tim Van Damme and Rogie King), my use of Ajax to display [...]]]></description>
			<content:encoded><![CDATA[<p>Back in October, <a href="http://tantek.com/">Tantek Çelik</a> wrote an entry on the <a href="http://microformats.org/">Microformats</a> blog, <a href="http://microformats.org/2009/10/06/recently-2009-09">featuring</a> my online identity, <a href="http://jaredhanson.net/">jaredhanson.net</a>, as an example of a beautifully styled <a href="http://microformats.org/wiki/hcard">hCard</a>.</p>
<p>While I don&#8217;t claim to be particularly adept at web design, especially compared to the other two featured individuals (<a href="http://timvandamme.com/">Tim Van Damme</a> and <a href="http://rogieking.com/#contact">Rogie King</a>), my use of <a href="http://en.wikipedia.org/wiki/Ajax_%28programming%29">Ajax</a> to display a status indicator was highlighted.</p>
<p>Since that time, I&#8217;ve had numerous people inquire as to how I added this functionality to my website.  In response, I&#8217;m supplying the source code that I use.  Download: <a href="http://www.backdrifter.com/assets/2010/01/24/online-status-indicators-with-ajax/web-presence.zip">web-presence.zip</a></p>
<p><span id="more-172"></span></p>
<p>Each of the instant messaging networks I have an account on (<a href="http://www.aim.com/">AIM</a>, <a href="http://www.google.com/talk/">Google Talk</a>, <a href="http://download.live.com/messenger">Windows Live</a>, <a href="http://www.skype.com/">Skype</a>, and <a href="http://messenger.yahoo.com/">Yahoo!</a>) have some form of API or web-based badge which can be queried using <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol">HTTP</a>.  On my server, I am running <a href="http://php.net/">PHP</a> code which issues requests to the particular service and translates the response into a <a href="http://en.wikipedia.org/wiki/JSON">JSON</a> object.  When my page loads, Ajax requests are made to retrieve these JSON objects.  Based on presence, the image is updated to reflect whether I am available or away.</p>
<p>For those interested in implementing similar functionality, this code should get you off the ground.  Remember to use the required credentials or keys for your account.  I&#8217;ve made notes where insertions are necessary.  Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.backdrifter.com/2010/01/24/online-status-indicators-with-ajax/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Twitter-like Flickr</title>
		<link>http://www.backdrifter.com/2007/08/06/a-twitter-like-flickr/</link>
		<comments>http://www.backdrifter.com/2007/08/06/a-twitter-like-flickr/#comments</comments>
		<pubDate>Tue, 07 Aug 2007 05:17:28 +0000</pubDate>
		<dc:creator>Jared Hanson</dc:creator>
				<category><![CDATA[Unknown]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[machinetags]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.backdrifter.com/2007/08/06/a-twitter-like-flickr/</guid>
		<description><![CDATA[Dave Winer outlined his latest Twitter mashup today.  It alerts the followers of his Twitter stream whenever he uploads a photograph from his iPhone to his stream on Flickr.  A Twitter for pictures, as he exclaims.
His mashup demonstrates the power of simple APIs and data formats.  It combines RSS 2.0, a specification [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.scripting.com/">Dave Winer</a> outlined his latest <a href="http://twitter.com/">Twitter</a> mashup today.  <a href="http://www.scripting.com/stories/2007/08/06/twitterForPictures.html">It</a> alerts the followers of his Twitter <a href="http://twitter.com/davewiner">stream</a> whenever he uploads a photograph from his <a href="http://www.apple.com/iphone/">iPhone</a> to his <a href="http://www.flickr.com/photos/scriptingnews/">stream</a> on <a href="http://www.flickr.com/">Flickr</a>.  A Twitter for pictures, as he exclaims.</p>
<p>His mashup demonstrates the power of simple APIs and data formats.  It combines <a href="http://cyber.law.harvard.edu/rss/rss.html">RSS 2.0</a>, a specification he developed, with the <a href="http://twitter.com/help/api">Twitter API</a>.  I&#8217;ve <a href="http://www.backdrifter.com/2007/07/06/flickring/">recently</a> done something similar, so I thought I&#8217;d provide some details on the process.</p>
<p><span id="more-68"></span></p>
<p><b>Configure Upload by Email</b></p>
<p><img src="/assets/2007/08/06/a-twitter-like-flickr/email-address.jpg" alt="Upload by Email" width="274" height="49" class="align-right"/>Flickr allows you to <a href="http://www.flickr.com/account/uploadbyemail/">upload by email</a>.  They provide you with a unique address, and any photos sent to that address will be published into your Flickr account.</p>
<p>This address should be added to your phone&#8217;s address book, as I&#8217;ve done with my <a href="http://www.blackberrypearl.com/">BlackBerry Pearl</a>.  When you snap a picture using the phone&#8217;s camera, an option is available to send as email.  Select Flickr from the address book, hit send, and the photo is on its way to the web.</p>
<p><b>Tag the Uploaded Photos</b></p>
<p><img src="/assets/2007/08/06/a-twitter-like-flickr/add-tags.jpg" alt="Tag Photos" width="274" height="60" class="align-right"/>Flickr also gives you the option of automatically applying tags to the photos you send as email.  You can tag them however you desire, &#8220;mobilephone&#8221; or &#8220;iphone&#8221; for example.  I&#8217;ve decided to use the <a href="http://machinetags.org/">machine tag</a> &#8220;flickr:agent=email&#8221; to indicate the photos I upload via email.</p>
<p>Machine tags are simple way to facilitate machine processing of tag-based data.  They are useful in a wide variety of contexts, and I really wish more services would implement support for them.  Since I am using this tag as a filter for a photo feed, using a machine tag is a natural fit.</p>
<p><img src="/assets/2007/08/06/a-twitter-like-flickr/machine-tags.jpg" alt="Machine Tags" width="146" height="67" class="align-left"/>Also, Flickr&#8217;s designers refined a nice user interface with regard to machine tags.  They are hidden underneath an expandable view, so they don&#8217;t clutter up the space of normal tags.  The effect can be seen on a recent <a href="http://www.flickr.com/photos/jaredhanson/990100886/">photograph</a>.</p>
<p><b>Generate the RSS Feed</b></p>
<p>A <a href="http://www.flickr.com/services/feeds/docs/photos_public/">public photos feed</a> can be generated based on certain criteria.  In my case, I&#8217;ve chosen to generate a feed of just my photos tagged &#8220;flickr:agent=email&#8221; in RSS 2.0 format.  In accordance with the documentation, the <a href="http://api.flickr.com/services/feeds/photos_public.gne?id=39636626@N00&#038;tags=flickr%3Aagent%3Demail&#038;format=rss_200">feed</a> uses the following options:<br />
<code><br />
id = 39636626@N00<br />
tags = flickr:agent=email<br />
format = rss_200<br />
</code></p>
<p><b>Process the Data</b></p>
<p>Once you&#8217;ve retrieved the RSS feed of photos, it can be parsed and processed by your application.  Dave chose to send a Twitter message, complete with a link to the photo.</p>
<p>I&#8217;ve done something different, however.  I translate the RSS feed into a <a href="http://www.json.org/">JSON</a>-formatted structure.  This <a href="http://www.backdrifter.com/resources/widgets/flickr.php">resource</a> is fetched using an <a href="http://en.wikipedia.org/wiki/Ajax_(programming)">Ajax</a> request and rendered as a widget on the <a href="http://www.backdrifter.com/">main page</a> of this site.</p>
<p>What you choose to do is entirely up to you.  As a starting point, the <a href="http://www.php.net/">PHP</a> code I use is available in this file: <a href="/assets/2007/08/06/a-twitter-like-flickr/flickr-rss-to-json.zip">flickr-rss-to-json.zip</a>.  It will certainly need modification to suit your purposes, but feel free to play around.  Let me know in the comments what you create!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.backdrifter.com/2007/08/06/a-twitter-like-flickr/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

