Update list-news.ps1

This commit is contained in:
Markus Fleschutz 2022-10-18 13:20:19 +02:00
parent a084275235
commit 4730d84c84

View File

@ -21,13 +21,12 @@ try {
[xml]$Content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content [xml]$Content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content
[int]$Count = 1 [int]$Count = 1
foreach ($Item in $Content.rss.channel.item) { foreach ($Item in $Content.rss.channel.item) {
# "→ $($Item.title)" & "$PSScriptRoot/write-typewriter.ps1" "$($Item.title)" 20 # ms speed
& "$PSScriptRoot/write-typewriter.ps1" "$($Item.title)" 30 # ms speed
if ($Count++ -eq $MaxCount) { break } if ($Count++ -eq $MaxCount) { break }
} }
$Source = $Content.rss.channel.title $Source = $Content.rss.channel.title
$Date = $Content.rss.channel.pubDate $Date = $Content.rss.channel.pubDate
" Updated: $Date by: $Source" " By *$($Source)* as of $Date"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"