Public/Get-Spotprent.ps1
<# .SYNOPSIS Retrieves recent cartoons #> function Get-Spotprent { Get-TrouwCartoon -Uri 'https://www.trouw.nl/achterpagina/spotprenten~bc9b7dca/' -Title Spotprent } # function Get-Spotprent # { # $DutchCulture = Get-Culture 'nl-NL' # $PreviousDate = [DateTime]::MaxValue # Invoke-WebRequest -Uri # | Select-Object -ExpandProperty Images # | Where-Object Src -Like 'https://image.trouw.nl/*' # | Select-Object -ExpandProperty Src # | ForEach-Object { # $Url = $_ # $DateText = ($_ -split '/')[-1] # $Date = [DateTime]::ParseExact($DateText, 'd-MMMM', $DutchCulture) # if ($Date -gt $PreviousDate) { $Date = $Date.AddYears(-1) } # [PSCustomObject]@{ # PSTypeName = 'UncommonSense.Trouw.Article' # Url = $Url # Date = $Date # Title = 'Spotprent' # Body = $Url # } # $PreviousDate = $Date # } # } |