Thursday, September 26, 2013

Weather Widget API (Yahoo Weather/GeoPlanet)

So the weather widget now pulls information from the Yahoo GeoPlanet and Yahoo Weather APIs. Unfortunately the GeoPlanet API limits the number of daily requests to 2000 per application (meaning the widget in general). The Yahoo Weather API on the other hand is extremely useful allowing 5000  hourly requests or 100,000 daily requests for each IP. It would be great to find a way to use Yahoo Weather without using the GeoPlanet API but that would involve some kind of web scraping and wouldn't be very reliable. Right now I am also investigating using AccuWeather, I need to contact them to get a API key, but unfortunately it may take some time to receive a response from them. For this reason I will continue to use the GeoPlanet and Yahoo Weather API's while searching for a better solution.

The widget itself is pretty functional. It allows a user to add, delete, favorite, and click to be redirected to specific yahoo weather page for a city. I am currently using the GeoPlanet and Yahoo Weather API's as well as jQuery to parse the xml returned from Yahoo Weather. It was actually quite a relief to learn that jQuery has xml parsing abilities. It saved me a lot of work. However, it is baffling that so many people on the web are encountering problems with adding jQuery. I didn't realize that multiple contentScriptFiles could be added, so after some research I was pretty confused. Luckily I didn't spend too much time trying to get that to work before figuring it out.

I feel now is the best time to switch my focus to the live icon and XUL. I feel the XUL will probably be the largest obstacle to overcome before our alpha presentations. Most of our group seems to be focused on it, so I figure maybe more people working on it will get better results. I just wonder how adding the XUL will affect the structure of the add-on, specifically concerning the main.js to script file message passing. I would love to be able to get rid of that method of message passing. It would be a huge convenience to be able to return a result directly to the object that called the function.

No comments:

Post a Comment