Getting a stock quote
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Getting a stock quote
Can someone help me get started with creating a Rev app that lets you enter a company symbol (e.g. IBM) and then retrieves the previous day's price for that stock by going to an internet site or using an RSS feed?
I am a teacher helping a student with a project.
Thanks in advance.
I am a teacher helping a student with a project.
Thanks in advance.
Example of where to get a stock quote
There are many sites that let you enter a stock symbol and return the price.
For example,
http://www.quoterss.com/
There many be others that are in a format better suited for use with Revolution.
For example,
http://www.quoterss.com/
There many be others that are in a format better suited for use with Revolution.
More Sources for stock quotes
Here are some other possibilities for entering ticker data and getting a stock price.
http://www.nasdaq.com/
http://www.smartmoney.com/rss/
http://www.2rss.com/rss_8072.html
http://www.nasdaq.com/
http://www.smartmoney.com/rss/
http://www.2rss.com/rss_8072.html
Hi petero,
The links that you posted don't provide any data. It is just a website with a form. You need to find a link that actually provides the data. I don't know what to enter in those forms. If you check out how the forms work, you may be able to figure out how to compose a URL or data to post to the CGI.
In the mean time you can do this:
If you don't like this, you could put the data from the url into a variable and parse it. You could also handler the data correctly, as XML. There is a tutorial that explains exactly how to do this here and the stack accompanying the article is here.
Best regards,
Mark
The links that you posted don't provide any data. It is just a website with a form. You need to find a link that actually provides the data. I don't know what to enter in those forms. If you check out how the forms work, you may be able to figure out how to compose a URL or data to post to the CGI.
In the mean time you can do this:
Code: Select all
set the htmlText of fld 1 to url"http://2RSS.com/rss2html.php?rss_url=http://www.googlestockquote.com/feed/rss2/"
Best regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
More details
Thanks so much for taking the time to help out.
If you go to
http://www.quoterss.com/
and enter IBM into the quote box, and press "Generate RSS feed", a URL appears that, when entered, displays exactly what I would like ... the number indicating the price.
Can Revolution parse through this to get that number?
If you go to
http://www.quoterss.com/
and enter IBM into the quote box, and press "Generate RSS feed", a URL appears that, when entered, displays exactly what I would like ... the number indicating the price.
Can Revolution parse through this to get that number?
Hi Petero,
I tried the following script in a button:
First, I tried it without setting the httpHeaders. This line is commented out in the script above. This didn't work. I got a meaningless page about how cool Google shares are. Then I suscribed to the RSS feed, using Apple Mail. This worked. Now I decided to set the httpHeaders (uncomment that line in the script above) and everything worked as expected. I am not sure what the effect of setting the httpHeaders is, but you can try. What do you get in the message box? it should start with "<title>QuoteRSS.com: IBM</title>" and continue with the HTML code for a table.
I tried several formats. Regardless of what I choose on the website, I always get the same URL. I also tried changing frmt=0 into frmt=1 and other numbers, but this didn't work. I even tried frmt=csv et cetera, without result.
Once you get this working, you can write your own script to parse the table, or you could set the htmlText of a field to myHtml.
Best,
Mark
I tried the following script in a button:
Code: Select all
on mouseUp
--set the httpHeaders to "User-Agent: Mozilla/5.0"
put url "http://www.quoterss.com/details.php?symbol=ibm&frmt=txt&Freq=0" into myHtml
-- now you could parse the data
put myHtml -- show in message box
end mouseUp
I tried several formats. Regardless of what I choose on the website, I always get the same URL. I also tried changing frmt=0 into frmt=1 and other numbers, but this didn't work. I even tried frmt=csv et cetera, without result.
Once you get this working, you can write your own script to parse the table, or you could set the htmlText of a field to myHtml.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode