<?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>TheMeyers.org Geek &#187; Flickr</title>
	<atom:link href="http://themeyers.org/geek/tag/flickr/feed/" rel="self" type="application/rss+xml" />
	<link>http://themeyers.org/geek</link>
	<description>Tracking my thoughts</description>
	<lastBuildDate>Wed, 01 Feb 2012 22:54:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Phanfare Badge</title>
		<link>http://themeyers.org/geek/2009/08/phanfare-badge/</link>
		<comments>http://themeyers.org/geek/2009/08/phanfare-badge/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 15:32:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Phanfare]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[API]]></category>
		<category><![CDATA[Flickr]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://themeyers.org/geek/?p=146</guid>
		<description><![CDATA[Sorry, I haven&#8217;t yet released the Phanfare-Widget&#8230;. I want to rework the code to use a single compound context variable, rather than many single value context variables.  I have started the transition, but I still need to debug and test the new version.  I realized that using the RSS feed interface, is limited compared to [...]]]></description>
			<content:encoded><![CDATA[<p>Sorry, I haven&#8217;t yet released the Phanfare-Widget&#8230;. I want to rework the code to use a single compound context variable, rather than many single value context variables.  I have started the transition, but I still need to debug and test the new version.  I realized that using the RSS feed interface, is limited compared to what can be accomplished using the Phanfare API interface.</p>
<p>I have been learning the Phanfare API by implementing a clone of Flickr&#8217;s Badge javascript code <strong>badge_code_v2.gne</strong>. This is a PHP module which you install on a server, which mimics the behavior of the Flickr badge function.  In fact you can use the <a href="http://www.flickr.com/badge.gne" target="_blank">Flickr Badge generator </a>and then replace the Flickr badge call &#8220;<code><strong>http://www.flickr.com/badge_code_v2.gne?count=10&amp;display=latest&amp;size=t&amp;layout=x&amp;source=user&amp;user=18867172%40N00" </strong></code>in the generated code, with a call to your Phanfare version, and it will just work!</p>
<p>There are some differences:</p>
<ol>
<li>For security the username and password for login into Phanfare is stored inside the PHP code.  Rather than being passed in the URL.</li>
<li>You can specify the <strong>album_id</strong> or <strong>year</strong> which the random images are pulled from.</li>
<li>I haven&#8217;t implemented the <strong>display</strong>, <strong>source,user</strong> arguments as it is always choosing from the specified Phanfare user</li>
</ol>
<p>Example <a href="http://themeyers.org/badge/testbadge.html">here</a></p>
<p>I have implemented a <strong>PhanfareAPI</strong> PHP class to encapsulate all the interaction with their site.  At first I was using <strong>SimpleXMLElement</strong> but didn&#8217;t like the organization of the returned  XML structure.  I wrote <strong>XMLParser</strong> which uses the PHP internal <strong>xml_parser_create, </strong>with<strong> startElement, endElement </strong>callbacks.  This returns a pure PHP nested array structure, which is much easier to handle when iterating over repeating structures with foreach.  The performance is slightly faster than <strong>SimpleXMLElement</strong>, and there is little (if any) special case code needed when walking the returned XML structures.</p>
<p>I am working on a Caching class to improve the performance using a sqlite DB.  The performance is excellent, but the programmer interface is not yet smooth.  The assumption is that the photo site meta information doesn&#8217;t change that often, and so can be cached for a longer period of time.</p>
<p>Example: The same badge test, using Caching <a href="http://themeyers.org/badge/fastbadge.html">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://themeyers.org/geek/2009/08/phanfare-badge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

