{"id":4830,"date":"2013-07-19T00:01:30","date_gmt":"2013-07-19T07:01:30","guid":{"rendered":"http:\/\/www.wambooli.com\/blog\/?p=4830"},"modified":"2014-08-30T07:51:46","modified_gmt":"2014-08-30T14:51:46","slug":"the-wambooli-tech-stock-index","status":"publish","type":"post","link":"https:\/\/www.wambooli.com\/blog\/?p=4830","title":{"rendered":"The Wambooli Tech Stock Index"},"content":{"rendered":"<p>Presenting a new feature here at the Wambooli web site, something I&#8217;ve been working on for several weeks. It&#8217;s the <em>Wambooli Tech Stock Index<\/em>. Just like the DOW, Nasdaq, and S&#038;P, this vital investment-tracking tool will become a standard for the world when it comes to high tech investing.<br \/>\n<!--more--><br \/>\nJust kidding.<\/p>\n<p>I love to code, so this project was more of an exercise to see if I could make it work. The notion started with my desire to put a stock tickers on the Wambooli main page. I&#8217;d just list a few stocks, such as Microsoft, Apple, and Google, and show how they&#8217;re doing.<\/p>\n<p>Such a task should be simple, I innocently thought. Stock information and other data is readily available on the web. Various websites provide XML feeds to tap into: You fetch an XML document, then your own page culls through the information and retrieves what it wants.<\/p>\n<p>I&#8217;ve done this type of thing before: The PorchCam web page pulls XML information from the government&#8217;s National Weather Service web site at <a href=\"http:\/\/weather.gov\/\" target=\"_blank\">http:\/\/weather.gov\/<\/a>. You can see the raw feed I use here on Wambooli: <a href=\"http:\/\/www.wambooli.com\/fun\/live\/weather.php\" target=\"_blank\">http:\/\/www.wambooli.com\/fun\/live\/weather.php<\/a>. From that page, I pluck out the items I want, then I display that info below the <a href=\"http:\/\/www.wambooli.com\/fun\/live\/\" target=\"_blank\">PorchCam image<\/a>.<\/p>\n<p>Like most programmers, because I figure I&#8217;ve done it once, I can do it again.<\/p>\n<p>For the XML feed, I chose Google Finance. You can view their raw XML data by <span style=\"color:red\">clicking this link [dead link]<\/span>, which displays GOOG, Google&#8217;s own stock. The XML feed is different from the standard Google Finance page for GOOG, <a href=\"https:\/\/www.google.com\/finance?q=NASDAQ%3AGOOG\" target=\"_blank\">shown here<\/a>.<\/p>\n<p>It took me a while to figure out how to access the raw feed&#8217;s data. (The Chrome web browser displays it well.) But once I did, I figured out how to create a list of &#8220;top&#8221; tech stocks and pull in a massive feed. I coded it all into a table and displayed it on the Wambooli Stock page.<\/p>\n<p>But I wasn&#8217;t happy.<\/p>\n<p>No, I needed an index to track the stocks&#8217; history. That meant brining in a database and historically tracking the Wambooli Tech Stock Index. That part was relatively easy once I figured out how to read the XML feed. To make the number interesting, I added a multiplier so that the starting value of the index was set to 100.<\/p>\n<p>Finally, what&#8217;s the point in tracking stocks unless you have a chart? So I coded, from scratch, my own line chart.<\/p>\n<p>I&#8217;ve always wanted to go graphics programming, even if it&#8217;s simple line-drawing and not a 3D animation of a tank tread crushing a human skull. Working on the chart was interesting, mostly because the chart&#8217;s data fluctuates; I had to make all the elements in the chart&#8217;s graphic adjustable, depending on how the chart&#8217;s line flows. That was a true challenge.<\/p>\n<p>In the end, the Wambooli Tech Stock Index was created, page put up, chart working. I&#8217;ve actually ran the page for several weeks now, fine tuning and adjusting elements &#8212; and I may continue to do so.<\/p>\n<p>Check out the Wambooli Tech Stock Index here: <span style=\"color:red\">http:\/\/www.wambooli.com\/fun\/stocks\/ [dead link]<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Presenting a new feature here at the Wambooli web site, something I&#8217;ve been working on for several weeks. It&#8217;s the Wambooli Tech Stock Index. Just like the DOW, Nasdaq, and S&#038;P, this vital investment-tracking tool will become a standard for the world when it comes to high tech investing.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-4830","post","type-post","status-publish","format-standard","hentry","category-main"],"_links":{"self":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4830","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4830"}],"version-history":[{"count":8,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4830\/revisions"}],"predecessor-version":[{"id":6504,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4830\/revisions\/6504"}],"wp:attachment":[{"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4830"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4830"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wambooli.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4830"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}