2

I have a test script with the command:

wget http://api.mesowest.net/v2/stations/timeseries?token=000&start=200505010000&end=200510310000&vars=air_temp_high_24_hour,air_temp_low_24_hour,relative_humidity,sea_level_pressure&units=english&output=csv&obtime=local&STID=KPHX     

yet the output of wget is

gdev@gdev-samsung:~/$ ./test
gdev@gdev-samsung:~/$ --2015-06-14 16:56:52--  http://api.mesowest.net/v2/stations/timeseries?token=f11c52999e0144dcb4461f4fb3ef2b53
Resolving api.mesowest.net (api.mesowest.net)... 63.251.153.118
Connecting to api.mesowest.net (api.mesowest.net)|63.251.153.118|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 9560276 (9.1M) [application/json]
Saving to: ‘timeseries?token=f11c52999e0144dcb4461f4fb3ef2b53’

100%[========================================================================>] 9,560,276   1.52MB/s   in 5.9s   

2015-06-14 16:57:01 (1.54 MB/s) - ‘timeseries?token=f11c52999e0144dcb4461f4fb3ef2b53’ saved [9560276/9560276]

Is the website link accidently using some sort of special characters that wget is cutting? Thanks for any help

1
  • 3
    Try to enclose URL with quotes : wget 'http://api.mesowest.net/v2/stations/timeseries?token=000&start=200505010000&end=200510310000&vars=air_temp_high_24_hour,air_temp_low_24_hour,relative_humidity,sea_level_pressure&units=english&output=csv&obtime=local&STID=KPHX' Commented Jun 14, 2015 at 21:08

1 Answer 1

3

You have special chars in your URL, like ?.

You best bet would be to enclose the full URL with single quotes so that those special chars will not be handled by the Shell :

wget 'http://api.mesowest.net/v2/stations/timeseries?token=000&start=200505010000&end‌​=200510310000&vars=air_temp_high_24_hour,air_temp_low_24_hour,relative_humidity,s‌​ea_level_pressure&units=english&output=csv&obtime=local&STID=KPHX'

As a side note : trying your URL i've encountered a "permission denied".

Depending on your authentication method you may have to pass some login :

wget --user=user --http-password=pass 'http://....'

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .