Public/Get-Dirkjan.ps1
function Get-Dirkjan { $DutchCulture = New-Object -TypeName System.Globalization.CultureInfo -ArgumentList 'nl-NL' Invoke-WebRequest -Uri 'https://dirkjan.nl' | Select-Object -ExpandProperty Content | pup '.post-navigation__day attr{href}' | ForEach-Object { $Date = (($_ -split '/')[4] -split '_')[0] Invoke-WebRequest -Uri $_ | Select-Object -ExpandProperty Content | pup '.cartoon img attr{src}' | ForEach-Object { [PSCustomObject][Ordered]@{ PSTypeName = 'UncommonSense.Dirkjan.Article' Url = $_ Date = [DateTime]::ParseExact($Date, 'yyyyMMdd', $DutchCulture) Title = 'Dirkjan' Body = $_ } } } } |