Skip to content

Instantly share code, notes, and snippets.

@proudlygeek
Created July 26, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save proudlygeek/fd521c0188ca45231266 to your computer and use it in GitHub Desktop.
Save proudlygeek/fd521c0188ca45231266 to your computer and use it in GitHub Desktop.
<?php
$apiKey = getenv('OPENWM_API_KEY') || file_get_contents( 'apikey');
$apiURL = 'http://api.openweathermap.org/data/2.5/forecast/daily';
$lat = $_GET[ 'lat' ];
$lon = $_GET[ 'lon' ];
echo file_get_contents( $apiURL . '?lat=' . $lat . '&lon=' . $lon . '&units=metric&cnt=1&APPID=' . $apiKey );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment