The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Parsing Ta-da Lists

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Red Handed

Posts: 1158
Nickname: redhanded
Registered: Dec, 2004

Red Handed is a Ruby-focused group blog.
Parsing Ta-da Lists Posted: Jan 19, 2005 7:49 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Parsing Ta-da Lists
Feed Title: RedHanded
Feed URL: http://redhanded.hobix.com/index.xml
Feed Description: sneaking Ruby through the system
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Red Handed
Latest Posts From RedHanded

Advertisement

Ruby is becoming the language for conversion of idea-to-task, for recording and processing notes. We’re all sitting here watching 37signals and DHH pour out streams of Rails applications for organizing your thoughts.

Tobias Luetke demostrates how simple it is to parse out your Ta-da lists with Ruby’s built-in XML reader:

 xml = Document.new(body)
 self.items = []
 XPath.each(xml, "//item/") do |elem| 
   task = Task.new
   task.title = XPath.match(elem, "title/text()").to_s
   task.date  = XPath.match(elem, "pubDate/text()").to_s
   task.link  = XPath.match(elem, "link/text()").to_s
   items << task
 end

See the whole script on his site.

Read: Parsing Ta-da Lists

Topic: linnn Previous Topic   Next Topic Topic: Hey, Guess Who Loves Ruby?


Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2014 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us