Getting and Parsing 10x10
----
1 2 <!--- build the wordsURL before getting the data ---> 3 <cfset year = DateFormat(Now(),"YYYY")> 4 <cfset month = DateFormat(Now(),"MM")> 5 <cfset day = DateFormat(Now(),"DD")> 6 <cfset hour = TimeFormat(Now(),"HH")> 7 <cfset wordsURL = "http://tenbyten.org/Data/#year#/#month#/#day#/#hour#/words.txt"> 8 9 <!--- connect to the url ---> 10 <cfhttp method="get" url="#wordsURL#" timeout="60"></cfhttp> 11 12 <cfset wordlist = cfhttp.FileContent> 13 14 <!--- write the data into a text file ---> 15 <cffile action="write" file="#ExpandPath('words.txt')#" output="#ToString(wordlist)#">
----
Reading the content is as simple as opening the file and traversing through it like so. I also added in a link to Google news. I've found it helpful to click on news bits in the past.
----
1 2 <cfhttp method="get" url="http://path/to/words.txt" timeout="60"></cfhttp> 3 4 <cfset wordlist = cfhttp.FileContent> 5 6 <ul><li> 7 <cfloop list="#wordlist#" delimiters="#chr(13)##chr(10)#" index="word"> 8 <cfoutput> 9 <a href="http://news.google.com/news?q=#word#" target="_blank">#word#</a> 10 </cfoutput> 11 </cfloop> 12 </li></ul>