Public/Get-FokkeSukke.ps1
function Get-FokkeSukke { Invoke-WebRequest -Uri 'https://www.nrc.nl/rubriek/fokke-sukke/' ` | Select-Object -ExpandProperty Content ` | pup 'a.nmt-item__link json{}' --plain ` | ConvertFrom-Json -Depth 10 ` | ForEach-Object { $_ } ` | ForEach-Object { $Url = 'https://nrc.nl{0}' -f $_.href $DateElements = ($Url -split '/')[4..6] [PSCustomObject][Ordered]@{ PSTypeName = 'UncommonSense.Nrc.Article' Url = $Url Date = Get-Date -Year $DateElements[0] -Month $DateElements[1] -Day $DateElements[2] Title = 'Fokke & Sukke' Body = (($_.children[0].children[0].children[0].'data-src') -split '\|')[1] } } } |