Skip to content

Commit

Permalink
Update scraper.php
Browse files Browse the repository at this point in the history
  • Loading branch information
handelaar committed Jun 30, 2017
1 parent 57ce393 commit d6beca5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scraper.php
Expand Up @@ -15,21 +15,21 @@

foreach ($dom->find("table th a[style='color: #590f56 !important;']") as $item) {
if (stristr($item->href,'planning-alert')) {
$targets[] .= 'https://mapalerts.corkcoco.ie/en/alerts' . $item->href;
$targets[] .= 'https://mapalerts.corkcoco.ie' . $item->href;
}
}
unset($dom,$html);

// Collect KML embedded in those URLs
print_r($targets);

foreach ($targets as $target) {
$fetch = file_get_contents($target);
echo getKML($fetch) . "\n";
}


function getKML($html) {
$tempA = explode('www.mapalerter.ie',$html);
$tempA = explode("mapalerter.ie\/maie\/kml\/",$html);
$tempB = explode('"]',$tempA[1]);
#print_r($tempA);
return $tempB[0];
Expand Down

0 comments on commit d6beca5

Please sign in to comment.