Public/Get-RubenLOppenheimer.ps1
function Get-RubenLOppenheimer { Invoke-WebRequest -Uri 'https://www.nrc.nl/rubriek/ruben-l-oppenheimer/' ` | Select-Object -ExpandProperty Links ` | Select-Object -ExpandProperty href ` | Where-Object { $_ -like '/nieuws/*' } ` | ForEach-Object { "https://www.nrc.nl$($_)" } ` | ForEach-Object { $Url = $_ $DateElements = ($_ -split '/')[4..6] [PSCustomObject]@{ PSTypeName = 'UncommonSense.Nrc.Article' Url = $Url Date = Get-Date -Year $DateElements[0] -Month $DateElements[1] -Day $DateElements[2] Title = 'Ruben L. Oppenheimer' Body = ( Invoke-WebRequest -Uri $_ | Select-Object -ExpandProperty Content | ForEach-Object { $_ | pup 'img attr{src}' --plain }) } } } |