mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-26 14:26:10 +01:00
Updated list-news.ps1
This commit is contained in:
parent
390b5ffe71
commit
bdc4cb1002
@ -84,7 +84,7 @@ try {
|
||||
}
|
||||
if ($reason -ne "") {
|
||||
$status = "⚠️"
|
||||
$pending = "with pending reboot ($($reason.substring(2)) in registry)"
|
||||
$pending = "with pending reboot (registry has $($reason.substring(2)))"
|
||||
}
|
||||
}
|
||||
Write-Host "$status $(hostname) is up for $(TimeSpanAsString $uptime) since $($lastBootTime.ToShortDateString()) $pending"
|
||||
|
@ -22,22 +22,21 @@
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$RSS_URL = "https://news.yahoo.com/rss/world", [int]$maxLines = 24, [int]$speed = 10)
|
||||
param([string]$RSS_URL = "https://news.yahoo.com/rss/world", [int]$maxLines = 24, [int]$speed = 5)
|
||||
|
||||
try {
|
||||
[xml]$content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content
|
||||
|
||||
$title = $content.rss.channel.title
|
||||
$URL = $content.rss.channel.link
|
||||
" "
|
||||
" UTC $title - $URL"
|
||||
" --- -----------------------------------------------------------------------"
|
||||
|
||||
Write-Host "`nUTC HEADLINES (by: " -noNewline
|
||||
Write-Host $URL -foregroundColor blue -noNewline
|
||||
Write-Host ")"
|
||||
Write-Host "--- ---------"
|
||||
[int]$count = 1
|
||||
foreach ($item in $content.rss.channel.item) {
|
||||
$title = $item.title
|
||||
$title = $item.title -replace "â","'"
|
||||
$time = $item.pubDate.Substring(11, 5)
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "❇️ $time $title" $speed
|
||||
& "$PSScriptRoot/write-typewriter.ps1" "$time • $title" $speed
|
||||
if ($count++ -eq $maxLines) { break }
|
||||
}
|
||||
exit 0 # success
|
||||
|
Loading…
Reference in New Issue
Block a user