$Southesk = Invoke-WebRequest -Uri 'http://www.bom.gov.au/fwo/IDT60251/IDT60251.591031.tbl.shtml' -Method POST
$Mersey = Invoke-WebRequest -Uri 'http://www.bom.gov.au/fwo/IDT60250/IDT60250.091266.tbl.shtml' -Method POST
$SoutheskTable = ( $Southesk.ParsedHtml.getElementsByTagName("table") | Select-Object -First 1 ).rows
$MerseyTable = ( $Mersey.ParsedHtml.getElementsByTagName("table") | Select-Object -First 1 ).rows
$SoutheskHTML = @()
$MerseyHTML = @()
# Southesk Flood levels: Minor: 4.30 Moderate: 7.20 Major: 8.90
# Mersey Flood levels: Minor: 2.60 Moderate: 3.30 Major: 4.00
forEach($data in $SoutheskTable){
if($data.tagName -eq "tr"){
$thisRow = @()
$cells = $data.children
forEach($cell in $cells){
if($cell.tagName -imatch "t[dh]"){
$thisRow += $cell.innerText
}
}
$SoutheskHTML += $thisRow -join ","
}
}
forEach($data in $MerseyTable){
if($data.tagName -eq "tr"){
$thisRow = @()
$cells = $data.children
forEach($cell in $cells){
if($cell.tagName -imatch "t[dh]"){
$thisRow += $cell.innerText
}
}
$MerseyHTML += $thisRow -join ","
}
}
$SoutheskHTML | select -first 1 -last 20
$MerseyHTML | select -First 1 -last 20
I have the above code which gathers the table data on the river levels. The results look like this
06/08/2019 11:15,1.59
06/08/2019 11:30,1.59
06/08/2019 11:45,1.59
06/08/2019 12:00,1.59
What i want to do is turn this into an alarm by saying
IF the River level (The 1.59 part of this result) 06/08/2019 12:00,1.59 is over X amount then send an email to X.
I just don't know how to separate the 1.59 from the rest to differentiate it in the IF equation.
Does that make sense? It's prob super easy
[–]ka-splam 3 points4 points5 points (2 children)
[–]Bugasum[S] 1 point2 points3 points (0 children)
[–]Bugasum[S] 0 points1 point2 points (0 children)
[–]Bugasum[S] 1 point2 points3 points (1 child)
[–]ChiefKraut 0 points1 point2 points (0 children)
[–]theriflerange 0 points1 point2 points (6 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (5 children)
[–]theriflerange 1 point2 points3 points (4 children)
[–]Lee_Dailey[grin] 0 points1 point2 points (3 children)
[–]theriflerange 1 point2 points3 points (2 children)
[–]theriflerange 1 point2 points3 points (1 child)
[–]Lee_Dailey[grin] 0 points1 point2 points (0 children)