Open aidaghayour opened 6 years ago
But there is a list of cities and their station ID's:
Look here: ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/
Specifically, you want the file:
ftp://client_climate@ftp.tor.ec.gc.ca/Pub/Get_More_Data_Plus_de_donnees/Station%20Inventory%20EN.csv
which can be pulled automatically usingwget
.
Note that those are FTP links with a username (not HTTP) so straight copy and paste into a web browser address bar may not work as expected.
Input is station ID. Station of each city has a code which is the script's input. Problem is that there is no list of city and their station's ID. The best I managed to do was looking up for data of a city on website, and extracting stationID that appears in the url. But I;m not sure of this is the only way or not!
P.S: you can see station ID at the end of second line. http://climate.weather.gc.ca/climate_data/daily_data_e.html?hlyRange=1953-01-01%7C2012-03-20&dlyRange=1942-01-01%7C2012-03-19&mlyRange=1942-01-01%7C2012-03-01&StationID=6720&Prov=NL&urlExtension=_e.html&searchType=stnName&optLimit=yearRange&StartYear=1998&EndYear=2008&selRowPerPage=25&Line=0&searchMethod=contains&Month=12&Day=31&txtStationName=st.+john%27s&timeframe=2&Year=2008