Skip to content

Instantly share code, notes, and snippets.

@martin9700
Last active March 13, 2017 13:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martin9700/8231909 to your computer and use it in GitHub Desktop.
Save martin9700/8231909 to your computer and use it in GitHub Desktop.
$QuakesData = Invoke-RestMethod -uri "http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/4.5_month.geojson"
[array]$Locations = ForEach ($Quake in ($QuakesData.Features | Select -First $Quakes))
{ [PSCustomObject]@{
Title = $Quake.properties.place
Magnitude = $Quake.properties.mag
TimeDate = [timezone]::CurrentTimeZone.ToLocalTime(([datetime]'1/1/1970').AddMilliseconds($Quake.properties.time))
Lon = $Quake.geometry.coordinates[0]
Lat = $Quake.geometry.coordinates[1]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment