Well, I came across this blog post by 'PragDave' where he writes a quick Ruby script that extracts the latest 5 entries from an RSS feed, writes it to a file and FTPs it to a remote box.
Seems simple enough but somehow the script just wasn't readable to me!!
So, I thought of writing my own quick hack in Python to do a simple comparison and so I wrote the following script in about 8 min. Most of the time was actually simply downloading FeedParser and running
sudo python setup.py install :)
Here's the script:
You can also see the output file.
This piece of code is a lot more readable, cleaner and faster for me to write. Also, I have never used the
feedparser modules before, this is my first time ever. It took just a few minutes for me to start using them both and they're doing all the hard work in this script.
After this comparison, I don't think there's an incentive for me to try Ruby, but of course, Ruby has other stuff going for it. However, as Bruce Eckel puts it, "if Ruby pushes the right buttons for you, great. It's probably the tool that will make you most productive right now, and that's what you should use. It doesn't really matter whether I am a fan (yet)."
Sidenote: I tried to post a comment or trackback to PragDave, but I couldn't find a way. If somebody can find a way to do that, please let me know.