<cfinclude template="config.cfm">

<cfset flickr = createobject("component", "CFlickr.Flickr")>
<cfset flickr.init(apikey, secret)>
<cfset ci = flickr.getCommentsInterface()>
<cfset ii = flickr.getInterestingnessInterface()>
<cfset pi = flickr.getPhotosInterface()>
<cfset photos = ii.getList(per_page=1,page=1).getPhotos()>
<cfset photo = pi.getInfo(photos[1].getId())>
<cfset comments = ci.getListPhoto(photo.getId())>
<cfset urls = photo.geturls()>

<cfinclude template="header.cfm">
<h1>CFlickr - Comments Interface Example</h1>

<cfoutput>
<p><img src="#photo.getPhotoUrl(photo.SIZE_SMALL_SQUARE)#" align="left"> Here is todays most "<a href="http://www.flickr.com/explore/interesting/">interesting</a>" photo from Flickr, and the comments people have made about it.</p>
<p>
	<cfloop from="1" to="#arraylen(urls)#" index="i">
	<a href="#urls[i].getUrl()#">#urls[i].getType()#</a>
	</cfloop>
</p>
<br clear="all">

<h3>Comments</h3>

<cfloop from="1" to="#arraylen(comments)#" index="i">
	<p>#comments[i].getText()#<hr></p>
</cfloop>

</cfoutput>