Weet iemand de coolblue status van de cpus als ze online komen is dit "Op voorraad " ?
Heb wat in powershell geknutseld om iedere X tijd de status te controleren.
Ik zie echter veel verschillende statussen, bij coolblue, nog maar x op voorraad of beperkt beschikbaar.
Of morgen in huis voor een in vooraad zijnde product.
Als iemand interesse in de code heeft hoor ik het ook graag uiteraard

.
mvg
--
Lijkt te werken voor de statussen, ik check op de innertext "Op voorraad " (letop de spatie aan het einde is vereist)
Morgen in Huis
Beperkte voorraad, bestel snel
@
justkais pbde mij voor het script maar ik deel hem even hier.
Geen garantie, support of dingen werkt niet etc, liever zelf de code test, verbeteren en hier terug posten , en niet om de 10 seconden laten checken.
Snel gemaakt, is niet heel snel / efficient in zoeken, dus als iemand dit kan verbeteren graag

.
PowerShell:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
| $urlsRyzen5000x = @("https://www.coolblue.nl/product/871396/amd-ryzen-5-5600x.html" , "https://www.coolblue.nl/product/871395/amd-ryzen-7-5800x.html", "https://www.coolblue.nl/product/871394/amd-ryzen-9-5900x.html","https://www.coolblue.nl/product/871392/amd-ryzen-9-5950x.html")
while (1) {
foreach ($CPU in $urlsRyzen5000x) {
$ryzendata= Invoke-WebRequest $CPU
$cpuname = ($CPU.split("-") | select -last 1).trim(".html")
Write-host "Controleren voorraad voor CPU $CPU" -ForegroundColor Yellow
$ryzenvoorraad = $ryzendata.AllElements | Where {($_.innertext -like "Op voorraad ") }| select -expandProperty innertext -first 1
if ($ryzenvoorraad) {
write-host "$cpuname op voorraad" -ForegroundColor Green
}
else {write-host "$cpuname nog niet op voorraad" -ForegroundColor red
}
}
write-host "Sleep voor 5 minuten."
start-sleep -seconds 300 #timeout-timer in seconden
} |
[
Voor 68% gewijzigd door
Phyt_ op 23-11-2020 07:34
. Reden: removed status morgen in huis, deed niks. ]
You know you ve played warcraft III too much when.... Your sitting next to a guy at the busstop waiting for a bus, and he stands up before the bus gets there, and you claim that hes map hacking