Real time link to data element

L

Leslie Coover

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!
 
P

Peter Michaux

Leslie said:
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
 
R

RobG

Peter said:
Leslie said:
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. :)
 
L

Leslie Coover

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.
 
P

Peter Michaux

RobG said:
Peter said:
Leslie said:
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
 
P

Peter Michaux

Leslie said:
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
 
P

Peter Michaux

Randy said:
Peter Michaux said the following on 10/26/2006 2:11 AM:

Biased are we?

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

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
 
L

Leslie Coover

Jim Land said:
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!
 
R

Randy Webb

Peter Michaux said the following on 10/26/2006 2:11 AM:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,815
Latest member
treekmostly22

Latest Threads

Top