forked from Geczy/google-weather-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
68 lines (52 loc) · 1.84 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Google Weather</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Google Weather API">
<meta name="author" content="Matthew Gates">
<!-- Le styles -->
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=PT+Sans' rel='stylesheet' type='text/css'>
<style>body{font-family: 'PT Sans', sans-serif;padding-top: 120px;padding-bottom: 40px;}</style>
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!--
Le fav icon
<link rel="shortcut icon" href="assets/ico/favicon.ico">
-->
</head>
<body>
<div class="container">
<div class="row">
<div class="span12">
<legend>Google Weather <small><a href="https://github.com/Geczy/google-weather-api">More info</a>.</small></legend>
<div id="details">
<p><?php
include_once('classes/google_weather.class.php');
/* Instantiate class. */
$googleWeather = new \Geczy\Weather\GoogleWeatherAPI();
/* Set degree. */
$degree = !empty($_GET['degree']) ? $_GET['degree'] : 'f';
$googleWeather->setDegree($degree);
/* Get data. */
$weatherData = $googleWeather->getWeather('Los Angeles');
/* Include the view. */
if ( $weatherData ) :
$viewsDir = dirname(__FILE__) . '/views/';
include($viewsDir . 'example1.php');
endif;
?></p>
</div>
</div>
</div>
<hr>
<footer>
<p><a tabindex="99" target="_TOP" href="http://mgates.me">© Matthew Gates 2012</a></p>
</footer>
</div> <!-- /container -->
</body>
</html>