Public/Get-NpoFeatured.ps1
function Get-NpoFeatured { param ( ) Invoke-WebRequest -Uri 'https://www.npostart.nl/speellijst/nieuw-op-npo-plus' | Select-Object -ExpandProperty Content | pup '.npo-ankeiler-tile-container json{}' --plain | ConvertFrom-Json -Depth 10 | ForEach-Object { [PSCustomObject]@{ PSTypeName = 'UncommonSense.Npo.Featured' Title = $_.children[0].Title Link = $_.children[0].Href Image = $_.children[0].children[0].children[0].'data-src' } } | ForEach-Object { $Content = Invoke-WebRequest -Uri $_.Link | Select-Object -ExpandProperty Content $Synopsis = $Content | pup 'meta[name="description"] attr{content}' --plain # $Synopsis = # ($Content | pup '.npo-header-episode-meta p text{}' --plain) ?? # ($Content | pup 'player-header-summary p text{}' --plain) $_ | Add-Member -NotePropertyName Synopsis -NotePropertyValue $Synopsis -PassThru -Force } } |