<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">

<channel>
<title>Hackszine: Online Investing</title>
<link>http://www.hackszine.com/blog/archive/online_investing/</link>
<description>O&apos;Reilly&apos;s Hacks Series reclaims the term &apos;hacking&apos; for the good guys--innovators who explore and experiment, unearth shortcuts, create useful tools, and come up with fun things to try on their own</description>
<language>en-us</language>
<copyright>Copyright 2009, O'Reilly Media, Inc.</copyright>
<lastBuildDate>Thu, 23 Oct 2008 19:53:54 -0800</lastBuildDate>
<pubDate>Fri, 02 Jan 2009 09:41:51 -0800</pubDate>
<generator>http://www.movabletype.org/?v=4.1</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<itunes:author>O'Reilly Media, Inc.</itunes:author>
<itunes:subtitle>Clever solutions to interesting problems.</itunes:subtitle>
<itunes:summary>Hackszine Podcast</itunes:summary>
<itunes:owner>
<itunes:email>webmaster@makezine.com</itunes:email>
</itunes:owner>
<category>Technology</category>
<itunes:category text="Technology">
</itunes:category>
<itunes:category text="Technology">
  <itunes:category text="Gadgets" />
</itunes:category>
<itunes:category text="Games &amp; Hobbies" >
</itunes:category>
<itunes:category text="Science">
</itunes:category>
<itunes:image href="http://makezine.com/images/hackszine/rss_icon.jpg" />
<itunes:explicit>no</itunes:explicit>


<item>
<title>Simple stock quote grabbing with Perl</title>
<itunes:summary>Hackszine reader 3riador wrote in to recommend a quick and easy way to grab stock quotes using Perl and the Finance::Quote CPAN module. The codebase is actively maintained and has been around for some time, having first been distributed as...</itunes:summary>
<description>
<![CDATA[<p>Hackszine reader 3riador wrote in to recommend a quick and easy way to grab stock quotes using Perl and the Finance::Quote CPAN module. The codebase is actively maintained and has been around for some time, having first been distributed as part of GNUCash before becoming its own project.</p>

<p>Paul Fenwick, one of the GNUCash developers, had this to say in an article for The Perl Journal in 2000:</p>

<blockquote>If you have a reason to watch the world's financial markets, and you know a little about perl, then you may find that the Finance::Quote package comes in handy. I personally use it to remind myself that I should never buy shares, as I have a good history of losing money on the stock exchange.  However, you can use Finance::Quote to help track those tasty stock options you've been offered, or even to help you build dynamic artwork driven by fluctuations in the world markets.</blockquote>

<p>Near as I can tell, the dynamic artwork that's referred to is the Stock Puppets presentation which was shown at 2000s Burning Man event (can anyone confirm this?). The idea was to have large marionettes controlled directly by stock market data, some servos, Basic Stamp microcontrollers, and IBM Thinkpads pulling market data using the Finance::Quote library.</p>

<p>To use Finance::Quote in your own projects is a simple task. Here's a few lines of code that will print the current price of Google shares:</p>

<blockquote>
#!/usr/bin/perl -w

<p>use strict;<br />
use Finance::Quote;</p>

<p><br />
my $q = Finance::Quote->new();<br />
my %data = $q->fetch('usa', 'GOOG');<br />
print $data{'GOOG', 'price'} . "\n";<br />
</blockquote></p>

<p>The Dabbler Blog has more information on installation and basic usage, and The Perl Journal article is a good resource for those wishing to delve any deeper.</p>

<p><a href="http://finance-quote.sourceforge.net/index.html">Finance::Quote Perl Library</a><br />
<a href="http://sethjust.wordpress.com/2008/10/23/fast-and-simple-stock-quotes-using-perl/">Dabbler Blog - Fast and Simple Stock Quotes Using Perl</a><br />
<a href="http://finance-quote.sourceforge.net/tpj/finance-quote.txt">Finance::Quote Article In The Perl Journal</a><br />
<a href="http://www.stockpuppets.com/howto-overview.html">Stock Puppets</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/10/simple_stock_quote_grabbing_wit.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/10/simple_stock_quote_grabbing_wit.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/10/simple_stock_quote_grabbing_wit.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/10/simple_stock_quote_grabbing_wit.html?CMP=OTC-7G2N43923558</guid>
<category>Perl</category>
<pubDate>Thu, 23 Oct 2008 19:53:54 -0800</pubDate>

</item>

<item>
<title>HOWTO - track stocks in Google Spreadsheets</title>
<itunes:summary> One of the most convenient features in Google Spreadsheets is the ability to pull live external data sources into any worksheet. Instead of copying data into your worksheet, when the linked source changes, the cells in your spreadsheet will...</itunes:summary>
<description>
<![CDATA[<p><span class="mt-enclosure mt-enclosure-image" style="display: inline;"><img alt="googfinance_20081013.png" src="http://www.hackszine.com/googfinance_20081013.png" width="600" height="407" class="mt-image-none" style="" /></span></p>

<p>One of the most convenient features in Google Spreadsheets is the ability to pull live external data sources into any worksheet. Instead of copying data into your worksheet, when the linked source changes, the cells in your spreadsheet will automatically update, which can save a lot of work if you pull reports regularly. This external data can be pulled from XML, other spreadsheet documents, and even (assuming you can bear to look) current and historical stock quotes from Google Finance.</p>

<p>Linking a worksheet to Google Finance is as simple as calling the <strong>GoogleFinance</strong> spreadsheet function. There are two ways to use it: you can pull current information on a ticker symbol, or you can pull historical trade data for a particular date range. Here's how:</p>

<p><br />
<strong>Retrieving Current Stock Information</strong></p>

<p>If you call the GoogleFinance function with two attributes, you can link to current market data for a particular ticker symbol. Just open any cell in your worksheet and enter the following:<br />
<blockquote><code><pre>=GoogleFinance("symbol", "attribute")</pre></code></blockquote></p>

<p>Replace "symbol" with the ticker id, such as GOOG or AAPL. The attribute parameter determines what information will be retrieved for that symbol.  There are a number of supported attributes, including <i>price</i>, <i>volume</i>, <i>tradetime</i>, <i>beta</i>, <i>pe</i> (price to earnings ratio), and <i>changepct</i>. If you omit the attribute parameter, it will default to "price". There are a number of other possible attributes which I haven't listed, including some specific to mutual funds, so check the documentation link below for the full list.</p>

<p><strong>Pulling Historical Stock Data</strong></p>

<p>Another thing that you can do is retrieve historical stock data over a large date range. Once you have this in your spreadsheets, you can use formulas to process, compare, and chart this information over time. </p>

<p>Here's the syntax for pulling historical stock data:</p>

<blockquote><code><pre>=GoogleFinance("symbol", "attribute", "start_date", "end_date", "interval")</pre></code></blockquote>

<p>As in the previous example, "symbol" needs to be replaced with the desired ticker ID. The "attribute" parameter, however, works a little differently. It's possible values are limited to <i>high</i>, <i>low</i>, <i>open</i>, <i>close</i>, <i>vol</i>, and <i>all</i>. "start_date" and "end_date" define the range of data that will be retrieved, and interval should be set to "DAILY", "WEEKLY", or a number from 1-7, which represents the number of days between measurements.</p>

<p>When the stock data is retrieved, a number of columns and rows will be consumed to capture the linked data, so make sure you have room to accommodate the data you've requested. It's not a bad practice to contain this data in separate sheet. One thing I noticed is that the column names always appear in French for me, despite my language preference settings. If you notice this as well, you'll just have to ignore it until it's fixed.</p>

<p>You can have up to 250 of these Google Finance feeds in a single spreadsheet. It's not an unlimited amount, but it's not exactly lightning fast to pull that much data anyway.  If you need more than that , one possible option is to separate your report data into different spreadsheets and then refresh them as needed.</p>

<p><a href="http://spreadsheets.google.com/ccc?key=pmunp4yfHOLPu0AuDp1F3YA">Example Google Finance Spreadsheet</a><br />
<a href="http://documents.google.com/support/spreadsheets/bin/answer.py?hl=en&answer=54198#">GoogleFinance Documentation and Examples</a></p>]]>
[&lt;a href="http://www.hackszine.com/blog/archive/2008/10/howto_track_stocks_in_google_s.html?CMP=OTC-7G2N43923558" /&gt;Read More&lt;/a&gt;]  
[&lt;a href="http://www.hackszine.com/blog/archive/2008/10/howto_track_stocks_in_google_s.html?CMP=OTC-7G2N43923558#comments" /&gt;Comments&lt;/a&gt;]
</description>
<link>http://www.hackszine.com/blog/archive/2008/10/howto_track_stocks_in_google_s.html?CMP=OTC-7G2N43923558</link>
<guid>http://www.hackszine.com/blog/archive/2008/10/howto_track_stocks_in_google_s.html?CMP=OTC-7G2N43923558</guid>
<category>Google</category>
<pubDate>Mon, 13 Oct 2008 20:53:07 -0800</pubDate>

</item>


</channel>
</rss>