Skip to content

Commit b01a456

Browse files
author
Markus Fleschutz
committed
Updated watch-news.ps1
1 parent 3f73ad7 commit b01a456

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

scripts/watch-news.ps1

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22
.SYNOPSIS
33
Watch the news
44
.DESCRIPTION
5-
This PowerShell script continuously lists the latest headlines by using a RSS (Really Simple Syndication) feed.
5+
This PowerShell script continuously lists the latest news by using a RSS (Really Simple Syndication) feed.
66
.PARAMETER URL
77
Specifies the URL to the RSS feed (default: https://news.yahoo.com/rss/world)
88
.PARAMETER updateInterval
9-
Specifies the update interval in seconds (default: 60 seconds)
9+
Specifies the update interval in seconds (default: 60)
10+
.PARAMETER speed
11+
Specifies the animation speed in milliseconds (default: 10)
1012
.EXAMPLE
1113
PS> ./watch-news.ps1
14+
Yahoo News - Latest News & Headlines (https://www.yahoo.com/news/world, UTC times)
15+
-----------------------------
16+
Swiss yodelling joins world cultural heritage list (12:07)
17+
...
1218
.LINK
1319
https://github.com/fleschutz/PowerShell
1420
.NOTES
@@ -34,8 +40,9 @@ function PrintNewerHeadlines([xml]$content, [string]$latestTimestamp, [string]$i
3440

3541
try {
3642
[xml]$content = (Invoke-WebRequest -URI $URL -useBasicParsing).Content
43+
$title = $content.rss.channel.title
3744
$webLink = $content.rss.channel.link
38-
& "$PSScriptRoot/write-animated.ps1" "Source: $webLink" $speed
45+
& "$PSScriptRoot/write-animated.ps1" "$title ($webLink, UTC times)" $speed
3946
& "$PSScriptRoot/write-animated.ps1" "-----------------------------" $speed
4047
$latestTimestamp = "2000-01-01"
4148
$icon = ""

0 commit comments

Comments
 (0)