Skip to content

Instantly share code, notes, and snippets.

@priithansen
Created June 11, 2012 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save priithansen/2909528 to your computer and use it in GitHub Desktop.
Save priithansen/2909528 to your computer and use it in GitHub Desktop.
Emhi weather extract
<?php
/* Simple HTML DOM Parser http://simplehtmldom.sourceforge.net/ */
include('simple_html_dom.php');
$html = file_get_html('http://www.emhi.ee/index.php?ide=21&v_kaart=0&go=5');
foreach($html->find('table[cellpadding=2] tr[bgcolor=#F7F7F7], tr[bgcolor=#FFFFFF]') as $row){
foreach($row->find('td') as $cell) {
$item[] = $cell->innertext;
}
$articles[] = $item;
unset($item);
}
print_r($articles);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment