Collect specific info from a site and display it on my site
I'm still kind of a rookie in this field but I've been searching for a very long time and can't seem to find anything so any help here will be greatly appreciated.
Basically, I have a wordpress website for sports and I have a page with a list of baseball players names and at the end开发者_JS百科 of every night I need to update this list with their statistics from the game they played that day/night.
For example (before they play their games)...
Catcher: Russell Martin
First baseman: Mark Texeira
Shortstop: Derek Jeter
...and so on for like 50 other names.
At the end of every night, I have to go search for those players and find out what their statistics were for the night and then update the list by typing in all of those statistics.
For example (after they played their games)...
Catcher: Russell Martin - 2 singles, 1 home run
First baseman: Mark Texeira - 1 double
Shortstop: Derek Jeter - 2 home runs
...and so on for like 50 other names.
Where or how can I find or create a script or plugin or something that will collect this specific data (stats) from another site and and display it on mine?
Maybe this resource would be useful but I don't know because I don't understand it when I try to read it:
http://developer.yahoo.com/fantasysports/guide/
http://developer.yahoo.com/fantasysports/guide/players-collection.html
Any help, feedback, anything will be greatly appreciated.
Thanks, Tony
You could do this a couple of ways.
The Yahoo! Fantasy Sports API is really the way to go - if you were to post specific questions (separately) about the Yahoo! API, regarding what you need help with, you might get more help on that end.
The other way to do it is page scraping, which basically involves programmatically going to a page that has the stats you want (the same way you would do it in your web browser), and parsing the HTML to get the right stats for the right players. This has two major problems, however:
- If the page layout changes, it might break your app
- If the web site you're scraping decides they don't like the way you're using their page, they can block you
So, the Yahoo! API really is the way to go. If the documentation baffles you, I would suggest starting by reading through this sub-section that shows the URIs for getting the player-specific data, followed by googl'ing for other people's code samples to get an idea of where to go.
精彩评论