<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: news code</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Fri, 25 Jul 2008 12:39:44 GMT</pubDate>
    <description>DZone Snippets: news code</description>
    <item>
      <title>Snippets 2 Launches!</title>
      <link>http://snippets.dzone.com/posts/show/956</link>
      <description>If you're a regular visitor to the site, you'll notice the layout has change a lot around here.. well, actually.. most of the code has too! Yes, you're now using Snippets 2, a total rewrite. It still lacks some of the things the old one lacked, but the infrastructure is now there. The old Snippets was notoriously unstable on the newer versions of Rails.&lt;br /&gt;&lt;br /&gt;New features include.. syntax coloring (for Ruby, primarily, at the moment), the ability to mark posts as 'private', an all new design, and better URLs and RSS, etc.&lt;br /&gt;&lt;br /&gt;Source access for this new version will be via SVN and will be made available in the next couple of weeks as the bugs are wriggled out of this version and I fix up all of the 'hacks'! Post your comments/praise/bug reports on the new version here..</description>
      <pubDate>Sat, 10 Dec 2005 14:46:50 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/956</guid>
      <author>peter (Peter Cooperx)</author>
    </item>
    <item>
      <title>Getting and Parsing 10x10</title>
      <link>http://snippets.dzone.com/posts/show/292</link>
      <description>Here's my source code in ColdFusion for parsing 10x10. I can't imagine it being different in other languages.&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;!--- build the wordsURL before getting the data ---&gt;&lt;br /&gt;&lt;cfset year = DateFormat(Now(),"YYYY")&gt;&lt;br /&gt;&lt;cfset month = DateFormat(Now(),"MM")&gt;&lt;br /&gt;&lt;cfset day = DateFormat(Now(),"DD")&gt;&lt;br /&gt;&lt;cfset hour = TimeFormat(Now(),"HH")&gt;&lt;br /&gt;&lt;cfset wordsURL = "http://tenbyten.org/Data/#year#/#month#/#day#/#hour#/words.txt"&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--- connect to the url ---&gt;&lt;br /&gt;&lt;cfhttp method="get" url="#wordsURL#" timeout="60"&gt;&lt;/cfhttp&gt;&lt;br /&gt;&lt;br /&gt;&lt;cfset wordlist = cfhttp.FileContent&gt;&lt;br /&gt;&lt;br /&gt;&lt;!--- write the data into a text file ---&gt;&lt;br /&gt;&lt;cffile action="write" file="#ExpandPath('words.txt')#" output="#ToString(wordlist)#"&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;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.&lt;br /&gt;&lt;br /&gt;----&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;cfhttp method="get" url="http://path/to/words.txt" timeout="60"&gt;&lt;/cfhttp&gt;&lt;br /&gt;&lt;br /&gt;&lt;cfset wordlist = cfhttp.FileContent&gt;&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;&lt;br /&gt;&lt;cfloop list="#wordlist#" delimiters="#chr(13)##chr(10)#" index="word"&gt;&lt;br /&gt;  &lt;cfoutput&gt;&lt;br /&gt;    &lt;a href="http://news.google.com/news?q=#word#" target="_blank"&gt;#word#&lt;/a&gt;&lt;br /&gt;  &lt;/cfoutput&gt;&lt;br /&gt;&lt;/cfloop&gt;&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Tue, 17 May 2005 10:35:39 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/292</guid>
      <author>kunal (kunal)</author>
    </item>
  </channel>
</rss>
