Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Use Google Finance for the Stocks widget System 10.4
If you'd like to use Google Finance (which in my opinion has been greatly improved and is far superior to the Quote finance page) in your Stocks widget, you just need to do a simple code replacement. Make a backup of your Stocks widget just in case, which you will find in /Library -> Widgets -> Stocks.wdgt. Then control-click the widget and select Show Package Contents from the pop-up menu. Find the file named Stocks.js, and open it up in your text editor of choice. Then perform the following code change: Line 654 reads as follows (note that there's an added line break in all of the following. Do not break the line when entering it yourself; make it one long line):
var url = 'http://finance.lycos.com/apple/default.aspx?symbols=' + 
 generateSymbolStringFromStrings (symbol, exchange);
To use Google Finance instead, make it look like this:
var url = 'http://finance.google.com/finance?q=' + 
generateSymbolStringFromStrings (symbol, exchange);
If you want to use Yahoo! Finance instead, simply replace the code mentioned above with this:
var url = 'http://finance.google.com/finance?q=' + 
generateSymbolStringFromStrings (symbol, exchange);
If you want the widget to also go to the page of your choice when you click the big Quote.com button on the back of the widget, you can also change the code at line 1304 with one of the following:
var url = 'http://finance.google.com/finance?q='
var url = 'http://finance.yahoo.com/q?s='
[robg adds: This worked as described. A simple way to make a backup of the widget is to just copy it to your user's Library/Widgets folder, then modify the copy. This leaves the original Apple-provided widget alone. Then open your modified copy from the Finder to see it on the Dashbaord.]
    •    
  • Currently 2.29 / 5
  You rated: 1 / 5 (7 votes cast)
 
[29,379 views]  

10.4: Use Google Finance for the Stocks widget | 2 comments | Create New Account
Click here to return to the '10.4: Use Google Finance for the Stocks widget' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Use Google Finance for the Stocks widget
Authored by: justbn on Jun 20, '06 06:59:52PM

I had to disable the widget and then add it back to the dashboard before the changes took effect.



[ Reply to This | # ]
10.4: Use Google Finance for the Stocks widget
Authored by: EdwardW on Jun 30, '06 07:30:02PM

Nice hint. I should point out that if you have mutual funds listed in your portfolio, this widget sends the string "MUTUAL:XXXXX" to Quote.com (where XXXXX is the symbol of the fund). However, neither Google nor Yahoo Finance recognizes this syntax. This requires one more little change to Stocks.js.

In the function generateSymbolStringFromStrings, I change the line:
if (exchange.length > 0) to the following:
if (exchange.length > 0 && exchange != "MUTUAL")



[ Reply to This | # ]