Public/Get-AntonDingeman.ps1
function Get-AntonDingeman { # $DutchCulture = New-Object -TypeName System.Globalization.CultureInfo -ArgumentList 'nl-NL' $Section = Invoke-WebRequest -Uri https://www.trouw.nl/cartoons/de-wereld-van-anton-dingeman~b1959d79/ ` | Select-Object -ExpandProperty Content | pup '.artstyle__main--container' --plain $Images = $Section | pup 'img.artstyle__image attr{data-original}' --plain $Dates = $Section | pup 'h3 text{}' --plain | Where-Object { $_ } | ForEach-Object { $_.Trim() } # ` # | ForEach-Object { # [PSCustomObject]@{ # PSTypeName = 'UncommonSense.Nrc.Article' # Url = $_ # Date = Get-Date #FIXME [DateTime]::ParseExact($DateText, 'd MMMM yyyy , H:mm', $DutchCulture) # Title = 'Anton Dingeman' # Body = $_ # } # Start-Sleep -Seconds 1 # Prevent nginx 429 error (too many requests) # } $Images # $Dates } |