Public/Get-AntonDingeman.ps1
function Get-AntonDingeman { $DutchCulture = New-Object -TypeName System.Globalization.CultureInfo -ArgumentList 'nl-NL' $Elements = Invoke-WebRequest -Uri https://www.trouw.nl/cartoons/de-wereld-van-anton-dingeman~b1959d79/ ` | Select-Object -ExpandProperty Content | pup '.artstyle__main--container json{}' --plain | ConvertFrom-Json | Select-Object -ExpandProperty Children $Dates = $Elements | Where-Object tag -In 'h3', 'p' | Select-Object -ExpandProperty text | ForEach-Object { [DateTime]::ParseExact($_, 'd MMMM yyyy', $DutchCulture) } $Images = $Elements | Where-Object tag -EQ figure | ForEach-Object { $_.Children.Children | Where-Object tag -EQ img | Select-Object -ExpandProperty 'data-original' } (0..($Images.Length - 1)) | ForEach-Object { [PSCustomObject]@{ PSTypeName = 'UncommonSense.Nrc.Article' Url = $Images[$_] Date = $Dates[$_] Title = 'Anton Dingeman' Body = $Images[$_] } } } |