Coder Social home page Coder Social logo

weatherforecast-serverside's Introduction

WeatherForecast-Serverside

Description

This is a webpage that allows you to search for weather information using the Google Geocode and Forecast.io APIs, and the results will be displayed in tabular format.

Search Form

  • A user first opens a page, called forecast.php, where he/she can enter an address (street, city, and state) and select the temperature unit (Fahrenheit, Celsius).
  • The form should include a forecast.io disclaimer, linking to ‘http://forecast.io/’.
  • If the user did not enter one of the data items, then an alert will be shown to let the user provide complete information.
  • Clear button is used for clearing the result area, all text fields, unselect the State value and reset the “Degree” field to its default value of Fahrenheit.

Google Geocode API

Web service URL: http://maps.google.com/maps/api/geocode/xml?address=325 W Adams,Los Angeles,CA

The response of this URL is an XML-formatted object. One key piece of data returned is the latitude and longitude values for the given address.

Forecast.io API

For the given location such as, queries like below:
https://api.forecast.io/forecast/YOUR_APIKEY/LATITUDE,LONGITUDE?units=units_v alue&exclude=flags When constructing the Forecast.io web service API call, you should provide five parameters:

  • The first parameter is your Forecast.io API key (a.k.a. the Dark Sky API key).
  • The second and the third parameter are the latitude and longitude values which are extracted from the XML-formatted data returned by the Google Geocode API.
  • The name of fourth parameter is units. The value of this parameter is either “us” or “si”. If the temperature is in degree Celsius, units=si and if the temperature is in degree Fahrenheit, units=us.
  • The name of the fifth parameter is exclude. The value of this parameter is “flags”.
The response from a query of the Forecast.io web service is a JSON-formatted object.

weatherforecast-serverside's People

Contributors

xingyekang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.