Results 1 to 6 of 6
May 15, 2006, 12:30 #1
- Join Date
- Jul 2005
- 0 Post(s)
- 0 Thread(s)
Ruby code, up for some (Hopefully.) constructive criticizm.
In an attempt to learn more about Ruby I've decided to create a feed reader. Nothing terribly complex yet, the code and an example of it's usage (Lines 28 through 45.) can be seen here:
A bit of an overview along with my thought process:
Line 2 - Shortcut accessor, example usage on line 40.
Line 6 - Even though there are modules for RSS versions 0.9 and 1.0, the module for version 2.0 appears to be reverse compatible.
Lines 11 and 12. - Inbound assignment along with a little bit of regex trickery to remove an leading "http://". Makes me question the proper use of instance variables.
Line 18 - An early attempt at error handling, it took quite a bit of digging to find the get_response function.
Lines 21 through 23. - Add the entries.
A live example of the output can be found here. There are no comments yet, as the more that I read into this the more often things change. I've also got to figure out how to escape the entities in the 6th group on the 5th entry so that they can resemble what's used in the feed. Just an attempt at learning Ruby and an early iteration, thanks alot for any insight, it's appreciated.