Originally Posted by
b_rad_1983
In the time it took you to do that, how long would it take to accomplish it in php?
Oh yea, if you know regular expressions you can do anything. For example, this is how easy it is to get the html of a website...
Code:
$url = 'http://scores.espn.go.com/mlb/scoreboard?date='.$espnDate;
//get the contents of the page
$handle = file_get_contents($url);
$str = htmlentities($handle);
Then with regular expressions you can just pick it apart. For instance this is how easy it is to get every espn game id for that day
Code:
$pattern = '/(\d*)-gamebox/';
preg_match_all($pattern,$str,$gameIDs);
Now in my $gameIDs variable, I have an array with every gameID for that day, so I can then loop through those and go to the boxscores to extract the player data and in the database it would all be tied to that game id.
Just something to think about if you ever wanted to expand.