Article Preview
Buy Now
COLUMN
From Scratch: A New Project
Issue: 2.1 (August/September 2003)
Author: William Leshner
Author Bio: William Leshner has been programming for twenty years and programming Macs for ten. He has spent a good deal of the last several years building REALbasic applications, including the now famous ResPloder.
Article Description: No description available.
Article Length (in bytes): 9,607
Starting Page Number: 40
Article Number: 2120
Resource File(s):
2120.zip Updated: 2013-03-11 19:07:57
Related Web Link(s):
http://quotes.nasdaq.com/quote.dll?page=xml
http://quotes.nasdaq.com/quote.dll?page=xml
Excerpt of article text...
The purpose of the "From Scratch" column is to spend more than one article building an application or, as we will do for the next three articles, a module that can be used in an application. We spent the last six articles building ShipIt!, an application that creates the documents of a software release (readme, user guide, email announcement, etc.). Now I would like to try something a little different: StocksSocket, a custom HTTPSocket control that can download stock information from the Internet. It will take us about three articles to build StockSocket and add it to a demo application I am tentatively calling Stocks. When we are finished we will have a control that could be dropped into any project that needs to get stock information from the Internet.
Stocks on the Web
It turns out that NASDAQ has a feed that provides stock information in an XML format. The feed is provided by an HTTP server and it is quite simple to get the feed using REALbasic 5's new HTTPSocket. In fact, you can try it out right now if you are connected to the Internet and you have REALbasic 5. Start a new REALbasic project. To Window1 drag a PushButton, a TCPSocket, and an EditField. Change the TCPSocket's super to HTTPSocket. In PushButton1's Action event put the following code:
TCPSocket1.Get "http://quotes.nasdaq.com/quote.dll?page=xml@@mode=stock@@symbol=AAPL"
...End of Excerpt. Please purchase the magazine to read the full article.