mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-16 17:51:28 +01:00
Add -useBasicParsing
This commit is contained in:
parent
3b9c9b68c2
commit
d2b4a78872
@ -11,7 +11,7 @@ $OrderBy="magnitude" # time, time-asc, magnitude, magnitude-asc
|
||||
|
||||
function ListEarthquakes {
|
||||
write-progress "Loading data ..."
|
||||
$Earthquakes = (Invoke-WebRequest -Uri "https://earthquake.usgs.gov/fdsnws/event/1/query?format=$Format&minmagnitude=$MinMagnitude&orderby=$OrderBy" -UserAgent "curl" ).Content | ConvertFrom-CSV
|
||||
$Earthquakes = (invoke-webRequest -uri "https://earthquake.usgs.gov/fdsnws/event/1/query?format=$Format&minmagnitude=$MinMagnitude&orderby=$OrderBy" -userAgent "curl" -useBasicParsing).Content | ConvertFrom-CSV
|
||||
foreach ($Quake in $Earthquakes) {
|
||||
new-object PSObject -Property @{ Mag=$Quake.mag; Depth=$Quake.depth; Location=$Quake.place; Time=$Quake.time }
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
param($RSS_URL = "https://yahoo.com/news/rss/world", [int]$MaxCount = 20)
|
||||
|
||||
try {
|
||||
[xml]$Content = (invoke-webRequest -URI $RSS_URL -useBasicParsing).Content
|
||||
[xml]$Content = (invoke-webRequest -uri $RSS_URL -useBasicParsing).Content
|
||||
"`n🌍 $($Content.rss.channel.title) 🌏"
|
||||
|
||||
[int]$Count = 0
|
||||
|
@ -8,7 +8,7 @@
|
||||
param($Location = "") # empty means determine automatically
|
||||
|
||||
try {
|
||||
$Weather = (Invoke-WebRequest http://wttr.in/${Location}?format=j1 -UserAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||
$Weather = (invoke-webRequest -uri http://wttr.in/${Location}?format=j1 -userAgent "curl" -useBasicParsing).Content | ConvertFrom-Json
|
||||
|
||||
$Area = $Weather.nearest_area.areaName.value
|
||||
$Region = $Weather.nearest_area.region.value
|
||||
|
Loading…
Reference in New Issue
Block a user