Combreal icon

trackVGRelease.ps1

Combreal | PRO | 01/02/24 02:34:07 PM UTC (Edited) | 0 ⭐ | 1695 👁️ | Never ⏰ | []
PowerShell |

1.16 KB

|

None

|

0 👍

/

0 👎

Function New-SMSnotification($text) {
    $params = @{
        "user"="ssssssss"; #user ID
        "pass"="ssssssss"; #API Key
        "msg"=$text;
    }
    
    Invoke-WebRequest -Uri https://smsapi.free-mobile.fr/sendmsg -Method POST -Body ($params|ConvertTo-Json) -ContentType "application/json" | Out-Null
}
 
$WebResponse = Invoke-WebRequest "https://www.cashexpress.fr/produits-occasions/jeu-nintendo,61/magasin-cannes-mandelieu,233.html?marques[]=8511&tri=dt_rec-desc"
$ScrappedTitles = $WebResponse.ParsedHtml.body.getElementsByTagName('a') | Where-Object {$_.href -like '*jeu-switch*'} | Select-Object -ExpandProperty nameProp
 
$Titles = ""
$LastEntry = ""
$firstEntry = $true
$ScrappedTitles | % {
    If ($_ -ne $LastEntry -And -Not $firstEntry) {
        $Titles += "`n" + $($_.substring(11, $_.Length -33)).replace('-',' ')
    }
    Elseif ($_ -ne $LastEntry -And $firstEntry) {
        $Titles += $($_.substring(11, $_.Length -33)).replace('-',' ')
        $firstEntry = $false
    }
    $LastEntry = $_
}
 
If($Titles -like "*pokemon*" -Or $Titles -like "*pokémon*") {
    New-SMSnotification "Pokemon game available at cashexpress Mandelieu."
}
 

Comments