Created
April 6, 2012 13:18
-
-
Save cfjedimaster/2319699 to your computer and use it in GitHub Desktop.
index.cfm
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
<!--- cache it to speed it up ---> | |
<cfif not cacheIdExists("cnnhtml")> | |
<cfhttp url="http://www.cnn.com"> | |
<cfset cnnhtml = cfhttp.filecontent> | |
<cfset cachePut("cnnhtml",cnnhtml)> | |
<cfelse> | |
<cfset cnnhtml = cacheGet("cnnhtml")> | |
</cfif> | |
<cfscript> | |
jsoup = createObject("java", "org.jsoup.Jsoup"); | |
doc = jsoup.parse(cnnhtml); | |
links = doc.select("img"); | |
</cfscript> | |
<cfloop index="e" array="#links#"> | |
<cfoutput> | |
#e.attr("src")# --- Title: #e.attr("title")# --- Alt: #e.attr("alt")#<br/> | |
</cfoutput> | |
</cfloop> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment