From 08295b989b829d2394f3f16660e56661f009acf3 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 13 Jul 2020 16:38:29 +0200 Subject: [PATCH] Improved news.ps1 --- Scripts/news.ps1 | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Scripts/news.ps1 b/Scripts/news.ps1 index 54e5fca6..d92a3052 100755 --- a/Scripts/news.ps1 +++ b/Scripts/news.ps1 @@ -6,14 +6,19 @@ # Source: github.com/fleschutz/PowerShell # License: CC0 # -Invoke-WebRequest -Uri 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml' -OutFile news.temp.xml -[xml]$FileContent = Get-Content news.temp.xml +#$RSS_URL = "http://feeds.skynews.com/feeds/rss/world.xml" +$RSS_URL = "https://yahoo.com/news/rss/world" +# $RSS_URL = "https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml" + +[xml]$FileContent = (Invoke-WebRequest -Uri $RSS_URL).Content + +write-host "" +write-host "+++ " $FileContent.rss.channel.title " +++" +write-host "" foreach ($item in $FileContent.rss.channel.item) { - write-output "+++"$item.title + write-host "* "$item.title } -remove-item news.temp.xml - exit 0