Created
September 28, 2016 16:11
-
-
Save neokoenig/d98f678054df0f08df77cba98ed30876 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!---Flickr Params---> | |
<cfparam name="flickr.url" default="https://api.flickr.com/services/rest/" /> | |
<cfparam name="flickr.key" default="YOURFLICKRKEY" /> | |
<cfparam name="flickr.userid" default="123456789@N03"> | |
<cfparam name="flickr.xml" default=""> | |
<!---Send my Request to Flickr: this will get an XML doc with all my public photosets---> | |
<cfhttp url="#flickr.url#"> | |
<cfhttpparam name="api_key" type="url" value="#flickr.key#" /> | |
<cfhttpparam name="method" type="url" value="flickr.photosets.getList" /> | |
<cfhttpparam name="user_id" type="url" value="#flickr.userid#" /> | |
<cfhttpparam name="per_page" type="url" value="15" /> | |
</cfhttp> | |
<cfscript> | |
flickr.xml = XmlParse(CFHTTP.FileContent); | |
photosets=XMLSearch(flickr.xml, '/rsp/photosets/photoset'); | |
pq=queryNew("title,link,source,description"); | |
i=1; | |
for(set in photosets){ | |
queryAddRow(pq); | |
querySetCell(pq, "title", photosets[i].title.xmltext, i); | |
querySetCell(pq, "link", "http://www.flickr.com/photos/#flickr.userid#/sets/#photosets[i].XmlAttributes['id']#/", i); | |
querySetCell(pq, "source", "http://farm#photosets[i].XmlAttributes['farm']#.static.flickr.com/#photosets[i].XmlAttributes['server']#/#photosets[i].XmlAttributes['primary']#_#photosets[i].XmlAttributes['secret']#_q.jpg", i); | |
querySetCell(pq, "description", photosets[i].description.xmltext , i); | |
i++; | |
} | |
writeDump(pq); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment