Skip to content

Instantly share code, notes, and snippets.

View mattclevyr's full-sized avatar

Matthew Williamson mattclevyr

View GitHub Profile
@mattclevyr
mattclevyr / api.php
Created May 30, 2013 19:12
Clevyr Weather API
<?php
include 'core/init.php';
echo "<pre>";
if(!empty($_GET['location']) == true && !empty($_GET['degree']) == true){
$data = GetWeatherData($_GET['location'], "en-US", $_GET['degree']);
if($data == false){
echo '{"LocationName":"false"}';
} else {
unset($data['CurrentData']['skyCode']);
print_r(json_encode(array_splice($data, 0, -5)));