Currently I am using this very popular code to get all the football scores:
[php]$title = $params->get(‘title’);
$fontc = $params->get(‘fontc’);
$fonts = $params->get(‘fonts’);
//this array contains sports and their URLs
$sports = array(
“NFL” => “http://sports.espn.go.com/nfl/bottomline/scores”);
$results = array();
foreach ( $sports as $sport => $url ) {
//get the page pointed to by $url
$page = file_get_contents($url);
//grab all variables out of the page
preg_match_all("/&([^=]+)=([^&]+)/", urldecode($page), $foo);
//loop through all the variables on the page
foreach ( $foo[1] as $key => $value ) {
if ( $sport == "NFL" && preg_match("/s_left\d+/", $value) ) {
$results[$sport][] = $foo[2][$key];
}
}
}
//calculate the sport with the most number of rows
$limit = 0;
foreach ( $results as $countMe ) {
$limit = max($limit, count($countMe));
}
//spit out the table with the right headers
echo "
“;
“
” . implode(” | ", array_keys($sports)). “ | $final |
---|
[/php]
and it works fantastically well however… I’d only like to get certain data say like the Cowboys game info and nothing more… NOT too sure how to do this, I’m just not really sure how to read the page, grab only that data.
Help would be greatly appreciated!
Thank you.