<cfinclude template="config.cfm">

<cfset flickr = createobject("component", "CFlickr.Flickr")>
<cfset flickr.init(apikey, secret, token)>
<cfset ci = flickr.getContactsInterface()>
<cfset ui = flickr.getUrlsInterface()>
<cfset contactList = ci.getList()>
<cfset contacts = contactList.getItems()>

<cfinclude template="header.cfm">

<h1>Example 4</h1>

<cfoutput>

<p>If you've set your user id and token in config.cfm, and you've got some friends on Flickr, you should see them listed below, click their name to go to their photo page</p>

<h3>Your Contacts</h3>


<cfloop from="1" to="#arraylen(contacts)#" index="i">
	<cfset contaturl = ui.getUserPhotos(contacts[i].getId())>
	<img src="#contacts[i].getIconUrl()#"> <a href="#contaturl#">#contacts[i].getUserName()#</a> <br>
</cfloop>

</cfoutput>