aspose file tools*
The moose likes Servlets and the fly likes StockQuote/ Scoreboard Tracker Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "StockQuote/ Scoreboard Tracker" Watch "StockQuote/ Scoreboard Tracker" New topic
Author

StockQuote/ Scoreboard Tracker

Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
I'm not sure which would be the right forum for this. But this would probably involve servlets so here goes:
Okay I want to create an application that can post updated Stock Quotes or updated Scores. It doesn't have to be real-time but recent would be nice. To track scores, my originaly idea was to go to a site such as espn.go.com and parse through all the html nd find the scores. As you can imagine this is very messy. I was wondering if anyone had a solution in terms of getting quotes on stocks or scores? How would you go about it in terms of how would you get the stock quotes or scores? I'm not worried about implementation, but rather how to obtain the information. If anyone has any ideas, I'd love to hear them. This isn't urgent, just something I've been thinking of for a few days.
Thanks,
Sean
Akanimo Udoh
Ranch Hand

Joined: Jun 11, 2001
Posts: 48
Sean,
I've done something similar to this and your solution is pretty close. Most of the bigger sports/biz sites have pretty standard URL queries (e.g. http://www.dictionary.com/cgi-bin/dict.pl?term=snippet : you can subst. any word for 'snippet' to get its definition ) from which you can post your own specific requests and get the custom responses you want. This is especially true for yahoo.
Being pretty lazy I used an XML parser to extract the data i needed. It works pretty well and saves me try to write parsing and pattern matching code that has already been optimized-to-death by XML implementations.
If the application will run independently on user machines you'll have to build in a meta-specification on how the queries should be formed just in case the site changes its query format. So the client machines will probably automatically connect to your site to get updates to query formats etc. If the appliction will be hosted centrally and accessed via a browser then you'll be able to do the necessary maintenance on the server-side.
Lemme know if this helps.
Akanimo.
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Thanks for the reply. I was hoping I wouldn't have to do any parsing. I'll have to wait for some more suggestions. Thanks though. I don't know anything about xml. It may be a good time to learn.
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Does anyone know how these larger websites get this information? I was hoping I could piggyback on their methods.
Jeff Sunder
Ranch Hand

Joined: Jun 26, 2001
Posts: 47
I was thinkging about writing my own stock quote tracker. And I came to the same conclusion as you, parsing the html is pretty messy. I tried to find work arounds, but couldn't come up with anything. There is a web site called www.isyndicate.com. I had to abandon my stock quote project due to time restraints, but I beleive they have a way to grab stock quotes by using xml. I wasn't able to research it any further, but its something you might want to look into. Let me know how it goes, maybe someday I can return my stock tracker project.
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Thanks for your reply. I'll definitely check it out.
Akanimo Udoh
Ranch Hand

Joined: Jun 11, 2001
Posts: 48
Sean,
I think it would really be worth your while to look into XML if you're really planning on doing web based data sourcing and extraction.
Contrary to popular belief XML is really very easy. The core XML can take about 1 or 2 hours to grasp, what really makes XML a bit bulky are the associated technologies like XSLT, DOM, SAX, Schema's, etc. All you'll really need will be the core XML, XPath, and the simple SAX parsing API.
I took about 2 weeks to learn XML and was even able to pass IBM's Certified XML developer based on that . The book I used was a wrox title called "XML for Beginners" that was quite good. You might want to take a look at it. You'll have to do it sometime, right?
Akanimo.
Sean Casey
Ranch Hand

Joined: Dec 16, 2000
Posts: 625
Akanimo,
Thanks for your reply.
You're definitely right, in that I'll probably have to learn it some time. I'm definitely going to check it out. It's encouraging that it's not that difficult to learn. I think I may put off some weekend to do it. Thanks for your advice.

- Sean
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: StockQuote/ Scoreboard Tracker