Posts Tagged ‘Ruby’

Easy stock quotes using Ruby

Sunday, August 23rd, 2009

Some time back, while working on a project for my Computational Finance course, I needed stock quotes for prominent firms from the BSE stock exchange. I needed data for the last five years, and manually copying the data from online sources was going to be very tiresome. While Google Finance, Yahoo Finance and other websites let you export search results for a data range into a CSV (comma separated values) file, doing this for 20 stocks was going be to a boring and repetitive task. Then I realized that for Yahoo Finance, by manipulating the URL pattern I could request the stock quote for any stock and for any date range. Once I realized this, it was a matter of writing a small program in Ruby to automate the entire task.
(more…)

RJS Magic

Saturday, June 27th, 2009

Recently, while working on a small application on Rails, I learned firsthand how easy and powerful RJS can be. I was amazed at how simple it is to save attributes to the data base using Ajax and then notify the user about successful operations or errors. Here is a small example that should show you how simple this is. (more…)