Stock Quotes From Yahoo in RSS or CSV

UPDATE: The location of the CSV file has changed since this post was originally written.

I’ve been trying to find a way to get stock quotes delivered to me (via email or RSS) for too long now. It turns out I just wasn’t searching very well because a solution was made back in 2005.

Check out the freely available script at TC’s Blog that generates a custom RSS feed based on the stock symbols of your choice.

As with most things, I decided this approach was slight overkill for my needs so I cut into the meat of TC’s script and took out the part I needed most. His script runs off of Yahoo! Finance’s little known ability to deliver quotes in a CSV file.

So here’s the URL you need:

http://quote.yahoo.com/d/quotes.csv?s=SYMBOL&f=sl1d1t1c1ohgv&e=.csv

If you toss that into fopen or curl (or whatever your weapon of choice is) and then parse the result using fgetcsv you’ll be good to go. Here’s a breakdown of the array that fgetcsv will return.

array[0] = Symbol
array[1] = Last Price
array[2] = Date
array[3] = Time
array[4] = Change
array[5] = Open Price
array[6] = Day High Price
array[7] = Day Low Price
array[8] = Trade Volume

Keep in mind that Yahoo! doesn’t give you real-time quotes. Their information comes on a twenty minute delay or so. Hopefully, using TC’s RSS script or just going straight to the CSV source will help you out.

Yahoo BetterTrades Online or OnLocation Classes

October 29th, 2006 | PHP, Programming | 2 Comments

Another Side Project: Michigan Sports Report

A few months back, in an attempt to keep on top of the news about the stumbling Indians, I built a site called the Ohio Sports Report. It’s simply a news aggregator made for sports teams in Ohio. The site updates throughout the day with links to articles in all the major local sports publications and more.

It’s been running so well that I’ve started another site, the painfully obvious to predict Michigan Sports Report. It’s the same concept as the Ohio Sports Report and runs on the same backend.

Check it out if you’re one of those Tigers fans that are all the rage now.

Michigan Auto Insurance free quotes

October 17th, 2006 | Side Projects | 0 Comments

JavaScript, .closed and Windows Update KB918899

I maintain a slightly aging Intranet application and came across a JavaScript “Permission Denied” error on a page handling pop-up windows. I know pop-up windows aren’t very Web 2.0 but you can save your evangelism for another day. In defense of all things flashy and new, the app is slowing migrating to AJAX. Very slowly.

Anyway, after some light searching I came across a thread at thescripts that goes into some detail on the problem before digressing into a programmer slapfight.

Let me try and save you the trouble of wading through that mess…
(more…)

October 11th, 2006 | JavaScript, Programming | 0 Comments

Tan Ling Wee’s New Calendar

After my post on the search for a decent JavaScript datepicker, I heard back from Tan Ling Wee:

Thanks for the compliment on the datepicker. I’ve rewritten the datepicker to make it more flexible and renamed it to Sparrowscripts datepicker, but have started charging a fee of $10 per download (unlimited use though).

Check out SparrowScripts for the datepicker and several other projects you might find useful.

October 9th, 2006 | JavaScript, Programming | 0 Comments

Charts & Graphs Using PHP & Flash

If you’re looking for a simple way to add charts and graphs with PHP you might want to check out PHP/SWF Charts. It’s a stupid-easy to use Flash based system that receives data from PHP includes.

There’s a free version with slightly limited features, but a full-featured single license is only $45 and it’s good for one domain name and all its sub-domains.

I prefer PHP/SWF Charts over alternatives like JpGraph.

October 7th, 2006 | Flash, PHP, Programming | 0 Comments