The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Funked Out Java+Ruby Aggregator

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.
Funked Out Java+Ruby Aggregator Posted: Sep 1, 2005 9:50 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Red Handed.
Original Post: Funked Out Java+Ruby Aggregator
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

Tim Bray. What a newb. But for being a Ruby nuby, he’s already posting hacks like he’s got recalescent digits. This JRuby stuff he’s got up right now makes me whinny!

 # Rename Java's Data class as JDate in Ruby
 include_class('java.util.Date') {|p,n| "J" + n }

 # Use Java's RSS/XML libs to fill a Ruby array
 ARGV.each do |arg| 
   feed = SyndFeedInput.new.build(XmlReader.new(URL.new(arg)))

   feed.entries.each do |entry|
     entry.setTitle "#{feed.getTitle}: #{entry.getTitle}" 

     aEntries << entry
   end
 end

 # Sort the entries in Ruby
 aEntries = aEntries.select { |e| e.getPublishedDate.between?(earlier, now) }
 aEntries.sort! { |a, b| b.getPublishedDate <=> a.getPublishedDate }
 aFeed.setEntries aEntries

Get the picture? The script of note is here. (The original agog struck on Tim’s blog.)

Read: Funked Out Java+Ruby Aggregator

Topic: ContextualService 0.1.0 Previous Topic   Next Topic Topic: Latest round of tech books

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use