I wanted to provide my users with a live weather feed for the area that they wanted to travel to. I was finally able to ( after many, many hours of things not working ) get the weather from Environment Canada when the user selected an area under the weather page.
I ran into too many issues to count, I really should have kept track of every issue, but I was pressed for time and trying to get the project finished. The main issues I had related to CORS, the default security settings in browers when you try and fetch information from a site other than the one you're viewing. After much reading, and experimenting, I finally realized that I wouldn't be able to get the weather with javascript alone, and that I would need to write a small php proxy to pass the data through from the webserver to the webpage.
I've written a bit of php in the past, so I was comfortable writing the php proxy.
Once I was able to fetch the weather, the second major issue I had was converting the xml file received into the weather data to be displayed. I could not easily parse the xml file, and spent way too may hours trying to make it work. In hindsite I should have given up on the xml approach, and tried to find another way to import and display the weather.
The Landing is a social site for Athabasca University staff, students and invited guests. It is a space where they can share, communicate and connect with anyone or everyone.
Unless you are logged in, you will only be able to see the fraction of posts on the site that have been made public. Right now you are not logged in.
If you have an Athabasca University login ID, use your standard username and password to access this site.
We welcome comments on public posts from members of the public. Please note, however, that all comments made on public posts must be moderated by their owners before they become visible on the site. The owner of the post (and no one else) has to do that.
If you want the full range of features and you have a login ID, log in using the links at the top of the page or at https://landing.athabascau.ca/login (logins are secure and encrypted)
Posts made here are the responsibility of their owners and may not reflect the views of Athabasca University.