Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
76 lines (61 sloc) 1.85 KB
require 'scraperwiki.php';
require 'scraperwiki/simple_html_dom.php';
// get base url
$url = '';
//should create automatic method to find range of pages
//set range of players to look through - currently there are 675
//need to add specific numbers such as Jan transfers to array
//scrape page for each player
foreach($players as $player)
$html = scraperwiki::scrape($url.$player);
// load html into dom
$dom = new simple_html_dom();
//turn dom into a string
$json = $dom;
//make the json string an array which i confusingly call an object
$obj = json_decode($json);
//get the fixture history for the player
foreach($obj->fixture_history->all as $rows)
//create results table
$results = array(
'index' => strval($player.$rows[1]),
'first_name' => strval($obj->first_name),
'last_name' => strval($obj->web_name),
'position' => strval($obj->type_name),
'team_name' => strval($obj->team_name),
'date' => strval($rows[0]),
'week' => strval($rows[1]),
'result' => strval($rows[2]),
'minutes_played' => strval($rows[3]),
'penalties missed'=>strval($rows[10]),
//check results
You can’t perform that action at this time.