mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-04-21 09:28:21 +02:00
Add parameter -useBasicParsing
This commit is contained in:
parent
67cb8ac816
commit
50221e502f
@ -8,7 +8,7 @@
|
|||||||
param($RSS_URL = "https://yahoo.com/news/rss/world", [int]$MaxCount = 20)
|
param($RSS_URL = "https://yahoo.com/news/rss/world", [int]$MaxCount = 20)
|
||||||
|
|
||||||
try {
|
try {
|
||||||
[xml]$Content = (invoke-webRequest -URI $RSS_URL).Content
|
[xml]$Content = (invoke-webRequest -URI $RSS_URL -useBasicParsing).Content
|
||||||
"`n🌍 $($Content.rss.channel.title) 🌏"
|
"`n🌍 $($Content.rss.channel.title) 🌏"
|
||||||
|
|
||||||
[int]$Count = 0
|
[int]$Count = 0
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
param($Location = "") # empty means determine automatically
|
param($Location = "") # empty means determine automatically
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Weather = (Invoke-WebRequest http://wttr.in/${Location}?format=j1 -UserAgent "curl" ).Content | ConvertFrom-Json
|
$Weather = (Invoke-WebRequest http://wttr.in/${Location}?format=j1 -UserAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||||
|
|
||||||
$Area = $Weather.nearest_area.areaName.value
|
$Area = $Weather.nearest_area.areaName.value
|
||||||
$Region = $Weather.nearest_area.region.value
|
$Region = $Weather.nearest_area.region.value
|
||||||
|
Loading…
Reference in New Issue
Block a user