469,630 Members | 1,200 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,630 developers. It's quick & easy.

Real time link to data element

http://finance.yahoo.com/

offers a wide range of financial data.

Would anyone have (or know where I can get) a sample of code that

I can use to link to a specific element of data (e.g., Last Trade) on

http://finance.yahoo.com/ or similar Web site. I would like the information
to update as financial information changes (i.e., a "real time" link).

I have some experience with standard Web pages but no knowledge of
JavaScript, perhaps you could point me in the direction of a few resources
(Web articles, books, etc.) where I can learn to do the type of coding
required to

achieve this type of link.

The following is a part of the HTML code on http://finance.yahoo.com/ that
identifies "Last Trade" of "54.00"

Last Trade:</td><td class="yfnc_tabledata1"><big><b><span
id="yfs_l10_vlo">54.00</span></b></big></td></tr><tr><td
class="yfnc_tablehead1" width="48%">

Thanks!
Oct 26 '06 #1
9 1627
Leslie Coover wrote:
http://finance.yahoo.com/

offers a wide range of financial data.

Would anyone have (or know where I can get) a sample of code that

I can use to link to a specific element of data (e.g., Last Trade) on

http://finance.yahoo.com/ or similar Web site. I would like the information
to update as financial information changes (i.e., a "real time" link).

I have some experience with standard Web pages but no knowledge of
JavaScript, perhaps you could point me in the direction of a few resources
(Web articles, books, etc.) where I can learn to do the type of coding
required to

achieve this type of link.

The following is a part of the HTML code on http://finance.yahoo.com/ that
identifies "Last Trade" of "54.00"

Last Trade:</td><td class="yfnc_tabledata1"><big><b><span
id="yfs_l10_vlo">54.00</span></b></big></td></tr><tr><td
class="yfnc_tablehead1" width="48%">
So if the user has the page open for a long time, you want the 54.00 to
change as the data on Yahoo! finance changes?

One way to do this would be this. The browser requests the page from
your server. Your server gets the data from the Yahoo! finance site by
a web service or screen scraping. You serve the page to the browser
with this initial data. Using JavaScript, the browser occassionaly
makes AJAX requests to your server for updates to this element. (This
repetitive type of request is called polling.) Your server gets the
current data from the Yahoo! site. Then your server returns the new
value to the browser as the AJAX response. The JavaScript in the
browser changes the value in the HTML and then the user sees the
up-to-date value.

javascript: The Definitive Guide 5th Edition by Flanagan from O'Reilly
Section 15.7 (changing the contents of the document) and chapter 20
(AJAX).

After you read that you may want to check out an AJAX library like that
from Yahoo! UI or Matt Kruse. However by this point you will know how
to write your own ajax library minus the browser bugs.

Peter

Oct 26 '06 #2

Peter Michaux wrote:
Leslie Coover wrote:
http://finance.yahoo.com/

offers a wide range of financial data.

Would anyone have (or know where I can get) a sample of code that

I can use to link to a specific element of data (e.g., Last Trade) on

http://finance.yahoo.com/ or similar Web site. I would like the information
to update as financial information changes (i.e., a "real time" link).
[...]
One way to do this would be this. The browser requests the page from
your server. Your server gets the data from the Yahoo! finance site by
a web service or screen scraping.
[...]
After you read that you may want to check out an AJAX library...
And if it is made available in a web page for your visitors, you may
want to find a good lawyer - commercial sites don't nomally like you
using their content without an agreement and probably payment. :-)

--
Rob

Oct 26 '06 #3
Thanks for reply

So (for sure) I can get this real-time data to my own Web site using
JavaScript?

What is ASP VBScript and ASP.NET all about?

A (probably more difficult, but actually better) option (for me) would be to
"script" directly into an MS Access db (on PC, no server issues). Do you
know anything about this? I know some Visual Basic code, could it be used
with some "scripting language"? I know very little about this but I am
assuming one can use JavaScript, ASP VBSScript and ASP.NET with HTML to do
various things, but I have no idea which works best for what, if they can be
used with code such as Visual Basic, or if there are other code sets that
are more effective.

Since I will need to put a lot of time and effort into leaning new codes I'd
like to set off on the right path, do you have any other suggestions besides
learning JavaScript? The reason scripting into MS Access would be better is
because it would make a better analysis tool, my objective is to analyze
financial data. But, if that is just too complicated I would settle for
"collecting" the data on my Web site.
"Peter Michaux" <pe**********@gmail.comwrote in message
news:11*********************@b28g2000cwb.googlegro ups.com...
Leslie Coover wrote:
>http://finance.yahoo.com/

offers a wide range of financial data.

Would anyone have (or know where I can get) a sample of code that

I can use to link to a specific element of data (e.g., Last Trade) on

http://finance.yahoo.com/ or similar Web site. I would like the
information
to update as financial information changes (i.e., a "real time" link).

I have some experience with standard Web pages but no knowledge of
JavaScript, perhaps you could point me in the direction of a few
resources
(Web articles, books, etc.) where I can learn to do the type of coding
required to

achieve this type of link.

The following is a part of the HTML code on http://finance.yahoo.com/
that
identifies "Last Trade" of "54.00"

Last Trade:</td><td class="yfnc_tabledata1"><big><b><span
id="yfs_l10_vlo">54.00</span></b></big></td></tr><tr><td
class="yfnc_tablehead1" width="48%">

So if the user has the page open for a long time, you want the 54.00 to
change as the data on Yahoo! finance changes?

One way to do this would be this. The browser requests the page from
your server. Your server gets the data from the Yahoo! finance site by
a web service or screen scraping. You serve the page to the browser
with this initial data. Using JavaScript, the browser occassionaly
makes AJAX requests to your server for updates to this element. (This
repetitive type of request is called polling.) Your server gets the
current data from the Yahoo! site. Then your server returns the new
value to the browser as the AJAX response. The JavaScript in the
browser changes the value in the HTML and then the user sees the
up-to-date value.

javascript: The Definitive Guide 5th Edition by Flanagan from O'Reilly
Section 15.7 (changing the contents of the document) and chapter 20
(AJAX).

After you read that you may want to check out an AJAX library like that
from Yahoo! UI or Matt Kruse. However by this point you will know how
to write your own ajax library minus the browser bugs.

Peter

Oct 26 '06 #4
"Leslie Coover" <lc******@cox.netwrote in
news:PF************@newsfe15.lga:
A (probably more difficult, but actually better) option (for me) would
be to "script" directly into an MS Access db (on PC, no server
issues).
So, what you *really* want to do is collect the information in a DB. In
that case, forget about Javascript--you will be better off using a server-
side scripting language such as ASP or PHP or ColdFusion. Those languages
offer direct access to the web (to scrape the number you want off Yahoo's
page) as well as direct access to a DB (to store the number). You'd set it
up to "poll" Yahoo as mentioned above, and just let the numbers dribble
into your DB.
Oct 26 '06 #5
RobG wrote:
Peter Michaux wrote:
Leslie Coover wrote:
http://finance.yahoo.com/
>
offers a wide range of financial data.
>
Would anyone have (or know where I can get) a sample of code that
>
I can use to link to a specific element of data (e.g., Last Trade) on
>
http://finance.yahoo.com/ or similar Web site. I would like the information
to update as financial information changes (i.e., a "real time" link).
[...]
One way to do this would be this. The browser requests the page from
your server. Your server gets the data from the Yahoo! finance site by
a web service or screen scraping.
[...]
After you read that you may want to check out an AJAX library...

And if it is made available in a web page for your visitors, you may
want to find a good lawyer - commercial sites don't nomally like you
using their content without an agreement and probably payment. :-)
I'm innocent. I was just answering the question. :)

Peter

Oct 26 '06 #6
Leslie Coover wrote:
>
Since I will need to put a lot of time and effort into leaning new codes I'd
like to set off on the right path, do you have any other suggestions besides
learning JavaScript?
Don't mess with ASP, PHP, etc for the server side. Use Ruby on Rails.
Don't use the JavaScript that comes as part of Rails. Don't even use it
when it starts to look easy and friendly.

Alternatives for Ruby/Rails are Perl/Catalyst or Python/TurboGears.
However Rails is the original and the others are probably further
behind in development. I haven't tried them

Don't mess with Flash on the client side. Just use HTML/CSS/JavaScript.

Use MySql or Postgre for the database. I haven't used Postgre but the
Postgre people definitely think they are better then the MySql people.

Get the Pragmatic Programmers books for Ruby and for Ruby on Rails.
Get the O'Reilly books for HTML, CSS and JavaScript.

Make sure you validate your HTML, CSS and use jslint.com to check your
JavaScript.
-Peter

Oct 26 '06 #7
Peter Michaux said the following on 10/26/2006 2:11 AM:
Leslie Coover wrote:
>Since I will need to put a lot of time and effort into leaning new codes I'd
like to set off on the right path, do you have any other suggestions besides
learning JavaScript?

Don't mess with ASP, PHP, etc for the server side. Use Ruby on Rails.
Biased are we?
Don't use the JavaScript that comes as part of Rails. Don't even use it
when it starts to look easy and friendly.
Absolutely.
Alternatives for Ruby/Rails are Perl/Catalyst or Python/TurboGears.
However Rails is the original and the others are probably further
behind in development. I haven't tried them
Then how can you say they are "probably behind"? They may be, they may
not be but without ever seeing them you can't even proposition which is
true.

If your argument for Ruby is that it was first, then you should be
biased towards ASP on the server as it was first.....
Don't mess with Flash on the client side. Just use HTML/CSS/JavaScript.
And worry with all the browser differences? Flash doesn't suffer that
limitation.
Get the O'Reilly books for HTML, CSS and JavaScript.
Not sure about the HTML and CSS, but if the O'Reilly books on CSS and
HTML are of the same quality as the O'Reilly book on JS then avoid all
three of them. The least bad JS book out is David Flanagan, as referred
to in the group FAQ.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 26 '06 #8
Randy Webb wrote:
Peter Michaux said the following on 10/26/2006 2:11 AM:
Leslie Coover wrote:
Since I will need to put a lot of time and effort into leaning new codes I'd
like to set off on the right path, do you have any other suggestions besides
learning JavaScript?
Don't mess with ASP, PHP, etc for the server side. Use Ruby on Rails.

Biased are we?
Yes. I've tried some other ways of developing web pages (Perl and PHP)
and like Rails the best.

Alternatives for Ruby/Rails are Perl/Catalyst or Python/TurboGears.
However Rails is the original and the others are probably further
behind in development. I haven't tried them

Then how can you say they are "probably behind"? They may be, they may
not be but without ever seeing them you can't even proposition which is
true.
I have looked at TurboGears briefly. It looks like it is behind and in
certain areas may never catch up because Python doesn't have certain
features Ruby does. These Ruby features are part of what gives Rails
it's magic. There are probably things in TurboGears that are better
than Rails. Perl is older so I imagine that it would have an even
harder time competing with Ruby. There are Cake and other similar PHP
frameworks to consider too. They are all cloning Rails for a reason.
I'm sure someone will out do Rails soon or have already but the huge
Rails community examining the code and improving it is an important
part of picking it as a framework.

Peter

Oct 26 '06 #9

"Jim Land" <RrrrFfffTttt(NO)@(SPAM)hotmail.comwrote in message
news:Xn*********************************@216.168.3 .44...
"Leslie Coover" <lc******@cox.netwrote in
news:PF************@newsfe15.lga:
>A (probably more difficult, but actually better) option (for me) would
be to "script" directly into an MS Access db (on PC, no server
issues).

So, what you *really* want to do is collect the information in a DB. In
that case, forget about Javascript--you will be better off using a server-
side scripting language such as ASP or PHP or ColdFusion. Those languages
offer direct access to the web (to scrape the number you want off Yahoo's
page) as well as direct access to a DB (to store the number). You'd set
it
up to "poll" Yahoo as mentioned above, and just let the numbers dribble
into your DB.
Correct

I know the word "scripting" is a very general word in IT, I may be misusing
it.
Is there one scripting language that you would recommend that would work

with MS Access (i.e., VBA) to create interconnectivity to remote

Web sites, somewhat like the relationship between HTML and JavaScript?

If I want to concentrate on one language should I choose ASP, PHP,
Coldfusion or

VBScript or something else?

I plan to use this at home, my connection to the Internet is through a

local service provider.

Thanks!
Oct 27 '06 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Stanimir Stamenkov | last post: by
30 posts views Thread by Raymond Hettinger | last post: by
7 posts views Thread by Fred Exley | last post: by
reply views Thread by Kurt Mueller | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.