monitoring path of exile prices

by Grzegorz Kulikowski

I know this has nothing to do with VMware, or powershell … i wrote this to check some price on path of exile, and get notification … (beep), when item is affordable. Script does not need explanation i guess since it’s just few lines. Link are the poe.trade link you would get after creating a search criteria for item.

Not the best way, but it does the job.

[sourcecode language=”powershell”]

While (0 -ne 1 ) {
$links = @(
http://poe.trade/search/yugakakekutusa’,
‘other link’,
)

foreach ($link in $links){
$data = (Invoke-WebRequest -Uri $link)
$items = $data.ParsedHtml.getElementsByTagName(‘tbody’) |? {$_.outerHTML -match "id=item-container"}
foreach ($item in $items)
{
$res = ([regex]::Matches((($item.outerHTML[0..350] -join ”) -split ‘>’)[0],’data-(name|buyout|ign)="[^"]*"’)).value
”| select @{n=’Item’;e={$res[0].split(‘=’)[1]}}, @{n=’price’;e={$res[2].split(‘=’)[1]}}, @{n=’seller’;e={$res[1].split(‘=’)[1]}}, @{n=’Link’;e={$link}}
if($res) {[console]::Beep(500,200)}
}
Start-Sleep -Seconds 1
}
Start-Sleep -Seconds 30
write-host "next run"
}

[/sourcecode]

You may also like

1 comment

mbourgon March 18, 2018 - 8:37 pm

Ha! I was just wondering if there was any powershell code out there for POE. Was actually looking to grab my gear and search it using where-object instead of their crappy filters.

Reply

Leave a Reply

Chinese (Simplified)DutchEnglishFrenchGermanHindiPolishRussianSpanish
Streaming live on Twitch right now.
CURRENTLY OFFLINE