<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 

	xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" 

	xmlns:content="http://purl.org/rss/1.0/modules/content/"

	xmlns:wfw="http://wellformedweb.org/CommentAPI/">
   <channel>
      <title>Flickr API | Croncast - Life is Show Prep</title>
	  <itunes:author>Kris and Betsy Smith</itunes:author>
      <link>http://www.croncast.com</link>
      <description>This is the keyword feed for Flickr API. Once cool, Kris and Betsy are now living on a cul de sac and breeding. Betsy really should be on the road making mad cash but that would interfere with breastfeeding. Podcasting for Download every M-W-F by 3:00 P.M. CST.</description>
      <language>en-us</language>
	  <copyright>Palegroove Studios 2004-2013</copyright>
	  		<itunes:explicit>No</itunes:explicit>

		<itunes:keywords>Croncast, Kris, Betsy, Comedy, Parenting, Funny, Palegroove, Croncast, eBay, Goodwill</itunes:keywords>

		<itunes:subtitle>This is the keyword feed for Flickr API. Once cool, Kris and Betsy are now living on a cul de sac and breeding. Betsy really should be on the road making mad cash but that would interfere with breastfeeding. Podcasting for Download every M-W-F by 3:00 P.M. CST.</itunes:subtitle>

 	<itunes:summary>This is the keyword feed for Flickr API. Once cool, Kris and Betsy are now living on a cul de sac and breeding. Betsy really should be on the road making mad cash but that would interfere with breastfeeding. Podcasting for Download every M-W-F by 3:00 P.M. CST.</itunes:summary>

 	<image> 

		<url>http://www.croncast.com/images/croncast_itunes.jpg</url>
 		<title>Flickr API | Croncast - Life is Show Prep</title>
 		<link>http://www.croncast.com</link>
 		<description>This is the keyword feed for Flickr API. Once cool, Kris and Betsy are now living on a cul de sac and breeding. Betsy really should be on the road making mad cash but that would interfere with breastfeeding. Podcasting for Download every M-W-F by 3:00 P.M. CST.</description>
 	</image> 	
	<itunes:image href="http://www.croncast.com/images/croncast_itunes.jpg" />
<itunes:category text="Comedy"/>
<itunes:category text="Society &amp; Culture">
</itunes:category>
<itunes:owner> 
			<itunes:name>Croncast - Kris and Betsy Smith</itunes:name>
	        <itunes:email>info@palegroove.com</itunes:email>
 </itunes:owner>
      <docs>http://www.croncast.com</docs>
      <generator>Palegroove</generator>
      <item>
         <title>Make the Flickr PHP API not so ugly and easier to use</title>
         <link>http://www.croncast.com/rssk/1329/Make-the-Flickr-PHP-API-not-so-ugly-and-easier-to-use_photo-frame_digital.php</link>
		 <category>Blog</category>
			<description><![CDATA[For months I have been bypassing the <a href=http://flickr.com/services/api/">Flickr API</a> and using RSS 2.0 feeds instead. The reason? They come with all the photo stream data that you need in a nice little package. Things like title, description, tags, date taken, date uploaded, image dimensions, etc.
<br><br>
What is missing from the RSS feed the ability to load comments with a photo and choose how many items are returned in the feed. The API, however, will let you load hundreds of images and load comments for each photo.
<br><br>
There is a catch though. The API is broken up into about a 75 different calls. Not one single call to the server can match the data that is returned in the RSS feed. To get the same data I need to make approximately 8 different calls to Flickr. Not good.
<br><br>
What use is the API?
<br><br>
It gives me the ability to create a historical back up of my photos in their most basic form with urls, date, descriptions (with html stripped) and tags. It also gives someone building an application a rich data source to do some of the things that Flickr isn't already doing - the purpose of an API.
<br><br>
After working with it for a few hours I became frustrated. PHP is my poison of choice and the PHP examples that Flickr uses all return serialized data. Which is great and easy to work with if you already know what the XML namespaces are but without them it is hard to access the data. And in some cases impossible without printing out the serialized array and looking at it because the returned serialized array's keys don't match the XML namespaces. Not to mention children are buried in deeper arrays that aren't as easy to access as say $title = $item->photo['title'].
<br><br>
Here's how I cleaned up the mess. If you are PHP guru then I am sure you could get this down to one script.
<br><br>
An 'include' script, sort of. View this script by URL on your server to see all name spaces:
<br><br>
1) Create a new PHP file declaring xml as file type - header("Content-Type: text/xml")<br>
2) Use the url that <a href="http://flickr.com/services/api/">Flickr supplies to return content in REST format</a><br>
3) Comment out the line for serialization<br>
4) Use PHP's file_get_contents() function<br>
5) echo the returned XML
<br><br>
<textarea cols="50" rows="7">
<?php
header("Content-Type: text/xml");
# call the API 
$flickr_url =  file_get_contents("http://api.flickr.com/services/rest/?api_key=YOUR-API-KEY&method=DATA-TO-RETURN);
echo $flickr_url;
?>
</textarea>
<br><br>
A loader script:
<br><br>
1) Create a loader script<br>
2) Call the include script - $resp = simplexml_load_file("YOUR INCLUDE SCRIPT URL");<br>
3) Get the data out by name space, the same ones that Flickr documents
<br><br>
<textarea cols="50" rows="10">
<?php
$resp = simplexml_load_file("INCLUDE-SCRIPT-URL");
// Check to see if the response was loaded, else print an error
if ($resp) {
	$results = '';  
    // If the response was loaded, parse it   
    foreach($resp->photo as $photo) {
	$title = $photo->title;
	echo $title;	
	}
}
?>
</textarea>
<br><br>
To view the name spaces that you will want to access simply open up the include script  by url in your browser.
<br><br>For now I will stick with the RSS 2.0 feeds for blog submissions but once I have some free time I will be using the API code above to create a cached archive for my own safe keeping.<br><br>Tags: <a href="http://www.croncast.com/key/photo frame">photo frame</a> <a href="http://www.technorati.com/tag/photo frame"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/photo frame.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/digital">digital</a> <a href="http://www.technorati.com/tag/digital"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/digital.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/Flickr API">Flickr API</a> <a href="http://www.technorati.com/tag/Flickr API"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/Flickr API.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/PHP">PHP</a> <a href="http://www.technorati.com/tag/PHP"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/PHP.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/simple">simple</a> <a href="http://www.technorati.com/tag/simple"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/simple.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/simplexml_load_file">simplexml_load_file</a> <a href="http://www.technorati.com/tag/simplexml_load_file"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/simplexml_load_file.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a>]]></description><content:encoded><![CDATA[For months I have been bypassing the <a href=http://flickr.com/services/api/">Flickr API</a> and using RSS 2.0 feeds instead. The reason? They come with all the photo stream data that you need in a nice little package. Things like title, description, tags, date taken, date uploaded, image dimensions, etc.
<br><br>
What is missing from the RSS feed the ability to load comments with a photo and choose how many items are returned in the feed. The API, however, will let you load hundreds of images and load comments for each photo.
<br><br>
There is a catch though. The API is broken up into about a 75 different calls. Not one single call to the server can match the data that is returned in the RSS feed. To get the same data I need to make approximately 8 different calls to Flickr. Not good.
<br><br>
What use is the API?
<br><br>
It gives me the ability to create a historical back up of my photos in their most basic form with urls, date, descriptions (with html stripped) and tags. It also gives someone building an application a rich data source to do some of the things that Flickr isn't already doing - the purpose of an API.
<br><br>
After working with it for a few hours I became frustrated. PHP is my poison of choice and the PHP examples that Flickr uses all return serialized data. Which is great and easy to work with if you already know what the XML namespaces are but without them it is hard to access the data. And in some cases impossible without printing out the serialized array and looking at it because the returned serialized array's keys don't match the XML namespaces. Not to mention children are buried in deeper arrays that aren't as easy to access as say $title = $item->photo['title'].
<br><br>
Here's how I cleaned up the mess. If you are PHP guru then I am sure you could get this down to one script.
<br><br>
An 'include' script, sort of. View this script by URL on your server to see all name spaces:
<br><br>
1) Create a new PHP file declaring xml as file type - header("Content-Type: text/xml")<br>
2) Use the url that <a href="http://flickr.com/services/api/">Flickr supplies to return content in REST format</a><br>
3) Comment out the line for serialization<br>
4) Use PHP's file_get_contents() function<br>
5) echo the returned XML
<br><br>
<textarea cols="50" rows="7">
<?php
header("Content-Type: text/xml");
# call the API 
$flickr_url =  file_get_contents("http://api.flickr.com/services/rest/?api_key=YOUR-API-KEY&method=DATA-TO-RETURN);
echo $flickr_url;
?>
</textarea>
<br><br>
A loader script:
<br><br>
1) Create a loader script<br>
2) Call the include script - $resp = simplexml_load_file("YOUR INCLUDE SCRIPT URL");<br>
3) Get the data out by name space, the same ones that Flickr documents
<br><br>
<textarea cols="50" rows="10">
<?php
$resp = simplexml_load_file("INCLUDE-SCRIPT-URL");
// Check to see if the response was loaded, else print an error
if ($resp) {
	$results = '';  
    // If the response was loaded, parse it   
    foreach($resp->photo as $photo) {
	$title = $photo->title;
	echo $title;	
	}
}
?>
</textarea>
<br><br>
To view the name spaces that you will want to access simply open up the include script  by url in your browser.
<br><br>For now I will stick with the RSS 2.0 feeds for blog submissions but once I have some free time I will be using the API code above to create a cached archive for my own safe keeping.<br><br>Tags: <a href="http://www.croncast.com/key/photo frame">photo frame</a> <a href="http://www.technorati.com/tag/photo frame"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/photo frame.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/digital">digital</a> <a href="http://www.technorati.com/tag/digital"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/digital.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/Flickr API">Flickr API</a> <a href="http://www.technorati.com/tag/Flickr API"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/Flickr API.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/PHP">PHP</a> <a href="http://www.technorati.com/tag/PHP"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/PHP.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/simple">simple</a> <a href="http://www.technorati.com/tag/simple"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/simple.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a> <a href="http://www.croncast.com/key/simplexml_load_file">simplexml_load_file</a> <a href="http://www.technorati.com/tag/simplexml_load_file"><img src="http://www.croncast.com/images/technorati.gif" border="0"></a><a href="http://www.croncast.com/keyrss/simplexml_load_file.rss"><img src="http://www.croncast.com/images/c4_rss_tiny.jpg" border="0"></a>]]></content:encoded>

         <pubDate>Tue, 29 Jan 2008 10:11:15 -0600</pubDate>         <guid isPermaLink="false">tag:croncast.com,1329</guid>

			<itunes:subtitle/>
				<itunes:summary>For months I have been bypassing the 


A loader script:

1) Create a loader script
2) Call the include script - $resp = simplexml_load_file(&quot;YOUR INCLUDE SCRIPT URL&quot;);
3) Get the data out by name space, the same ones that Flickr documents


photo as $photo) {
	$title = $photo-&gt;title;
	echo $title;	
	}
}
?&gt;


To</itunes:summary>
				<itunes:explicit>no</itunes:explicit>
				<itunes:keywords>photo frame, digital, Flickr API, PHP, simple</itunes:keywords> 
      </item>
   </channel>
</rss>