Android and Web app for Weather Retrieval
The app fetches weather information of worldwide cities based on name or US Zip codes using Yahoo! Geoplanet and Yahoo! RSS Weather feed API's.
- HTML is used to display the basic form and gather the relevant data.
- Javascript is used to validate the form.
- CSS is used to apply styling to the document.
- PHP script is used to parse XML files that are generated using user data entered in the form.
- The HTML form collects either a US ZIP code or a city name and submits this form data by POST method to the server.
- Before the transaction to the server takes place, the form is validated using Javascript to check for empty fields and invalid entries.
- The PHP script gets killed if invalid data was entered.
- If valid data was entered, PHP script is executed.
- Based on ZIP code or city name, an URL is constructed to query the Yahoo! Geoplanet API. This returns a XML containing unique 'Where on Earth (WOEID)' ID's. This XML is parsed using simpleXML library to extract the WOEID(s).
- After the retrieval of WOEID(s), another URL is constructed comprising of WOEID to query Yahoo RSS Weather feed. The query returns the weather information for a specific WOEID.
- The returned XML is parsed using xpath to display the required table. Empty fields are displayed as N/A.