Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfset rssUrl = "http://feeds.nationalgeographic.com/ng/photography/photo-of-the-day/">
- <cffeed action="read" source="#rssUrl#" query="entries" properties="info">
- <!---
- <cfdump var="#info#">
- <cfdump var="#entries#">
- --->
- <cfset dir = expandPath("./ngg")>
- <cfif not directoryExists(dir)>
- <cfdirectory action="create" directory="#dir#">
- </cfif>
- <cfloop query="entries">
- <cfset filename = hash(linkhref) & "." & listlast(linkhref, ".")>
- <cfoutput>checking #filename#... </cfoutput>
- <cfif not fileExists(dir & "/" & filename)>
- <cfhttp method="get" getAsBinary="yes" url="#linkhref#" path="#dir#" file="#filename#">
- downloading!<br/>
- <cfelse>
- skipped<br/>
- </cfif>
- </cfloop>
- Done.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement