This is the URL i'm using:
http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.csv
And I need to output it like this:
Downloading earthquake data from USGS ... Largest magnitude quake is: Time: 2016-10-17T06:14:58.370Z Latitude: -6.0526 Longitude: 148.8617 Location: 78km WNW of Kandrian, Papua New Guinea Magnitude: 6.9 Depth: 35
I already have a function that reads and decodes the lines this is a bit of the code:
def online_display_largest_quake():
print('Downloading earthquake data from USGS ...')
earthquakes = get_text_lines_from_url('http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.csv')
print (earthquakes)
best_mag = 0
best_item = []
for (item) in earthquakes[1:]:
if float(item[4]) > best_mag:
best_mag = float(str(item[4]))
best_item = item
earthquake_output(best_item)