-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
213 lines (205 loc) · 6.59 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?php
require('config.php');
require('vendor/autoload.php');
date_default_timezone_set("US/Central");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<script src="home.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
<!-- Add your site or application content here -->
<div class="title">
<h1>Welcome Home</h1>
</div>
<div class="links row hidden-xs">
<div class="col-lg-2 col-md-2 col-sm-4">
<a href="http://bitbucket.com">
<img src="images/Bitbucket.svg" />
Bitbucket
</a>
</div>
<div class="col-lg-2 col-md-2 col-sm-4">
<a href="http://github.com">
<img src="images/github.svg" />
Github
</a>
</div>
<div class="col-lg-2 col-md-2 col-sm-4">
<a href="http://podio.com">
<img src="images/Podio.svg" />
Podio
</a>
</div>
<div class="col-lg-2 col-md-2 col-sm-4">
<a href="http://sites.hdg/info.php">
<img src="images/php.svg" />
PhpInfo
</a>
</div>
<div class="col-lg-2 col-md-2 col-sm-4">
<a href="http://news.ycombinator.com">
<img src="images/y-combinator.svg" />
Hacker News
</a>
</div>
<div class="col-lg-2 col-md-2 col-sm-4">
<a href="http://feedly.com">
<img src="http://s.cafebazaar.ir/1/upload/icons/com.devhd.feedly.png" />
Feedly
</a>
</div>
</div>
<hr class="hidden-xs" />
<div class="row">
<div class="weather col-md-4 col-lg-3 clearfix">
<?php
$cu = curl_init();
curl_setopt($cu, CURLOPT_URL, 'https://api.forecast.io/forecast/0b99f4b010921b26f03d8c216358378d/41.3510,-88.8391');
curl_setopt($cu, CURLOPT_HTTPHEADER, $config['classdojo']);
curl_setopt($cu, CURLOPT_RETURNTRANSFER, 1);
$weather = curl_exec($cu);
curl_close($cu);
$weather = json_decode($weather);
?>
<h1>Weather</h1>
<div class="col-sm-6">
<h3>Today</h3>
<i class="wi wi-forecast-io-<?php echo $weather->daily->data[0]->icon; ?>"></i>
<p>
<?php
echo $weather->daily->data[0]->summary . '<br />';
echo round($weather->currently->apparentTemperature, 0) . '°<br />';
?>
</p>
</div>
<div class="col-sm-6">
<h3>Tomorrow</h3>
<i class="wi wi-forecast-io-<?php echo $weather->daily->data[1]->icon; ?>"></i>
<p>
<?php
echo $weather->daily->data[1]->summary . '<br />';
echo round($weather->daily->data[1]->apparentTemperatureMin, 0) . '° -' . round($weather->daily->data[1]->apparentTemperatureMax, 0) . '°<br />';
?>
</p>
</div>
</div>
<div class="twitter col-md-8 col-lg-9">
<h1>Twitter</h1>
<div class="">
<?php
$tweets = require('functions/twitter.php');
foreach($tweets as $k => $v) {
echo "<div class='row'>";
echo "<div class='col-sm-12'>";
echo "<a href='http://twitter.com/" . $v->user->screen_name . "' target='_blank'>";
echo "<img src='" . $v->user->profile_image_url . "' />";
echo "</a>";
echo '<h3>';
echo "<a href='http://twitter.com/" . $v->user->screen_name . "' target='_blank' style='color:#000'>";
echo $v->user->name;
echo "</a>";
echo '</h3>';
if(isset($v->entities->urls['0']->url)) {
echo "<a href='" . $v->entities->urls['0']->url . "' target='_blank'>";
}
echo $v->text;
if(isset($v->entities->urls['0']->url)) {
echo "</a>";
}
echo "</div>";
echo "</div>";
}
?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<h1>Podio</h1>
<?php
Podio::setup($config['podio']['client-id'], $config['podio']['client-secret']);
Podio::authenticate_with_app($config['podio']['ww-app-id'], $config['podio']['ww-app-secret']);
$ww = PodioItem::filter($config['podio']['ww-app-id']);
foreach($ww as $week) {
if ($week->title == 'Jake Neumann') {
$week_start = $week->fields['1']->values['start'];
if((time()-(60*60*24*7)) < strtotime($week_start->format('Y-m-d H:i:s'))) {
// var_dump( $week->fields );
foreach( (array) $week->fields as $week) {
foreach( (array) $week as $day) {
if (is_object($day) && $day->type == 'app') {
echo '<h4>' . $day->label . '</h4>';
foreach($day->values as $proj) {
echo '<a href="' . $proj->link . '" target="_blank">';
echo $proj->title;
echo '</a>';
echo '<br />';
}
}
}
}
}
}
}
?>
</div>
<div class="classdojo col-md-6">
<div class="col-sm-12">
<h1>Class Dojo</h1>
</div>
<?php
$cu = curl_init();
curl_setopt($cu, CURLOPT_URL, 'https://home.classdojo.com/api/parent/5603218c458be92d1d471717/student');
curl_setopt($cu, CURLOPT_HTTPHEADER, $config['classdojo']);
curl_setopt($cu, CURLOPT_RETURNTRANSFER, 1);
$res = curl_exec($cu);
curl_close($cu);
$cu = curl_init();
curl_setopt($cu, CURLOPT_URL, 'https://home.classdojo.com/api/storyPost');
curl_setopt($cu, CURLOPT_HTTPHEADER, $config['classdojo']);
curl_setopt($cu, CURLOPT_RETURNTRANSFER, 1);
$mes = curl_exec($cu);
curl_close($cu);
$res = json_decode($res);
$res = $res->_items[0];
$mes = json_decode($mes);
$mes = $mes->_items[0];
?>
<div class="col-sm-6">
<?php
echo '<h3>Teacher</h3> ' . $res->teacher->title . ' ' . $res->teacher->lastName . '<br />';
?>
</div>
<div class="col-sm-6">
<?php
echo '<h3>Points</h3> ' . $res->currentPoints . '<br />';
?>
</div>
<div class="col-sm-12">
<?php
echo '<h3>Latest Message (' . date('m/d/Y', strtotime($mes->createdAt)) . ')</h3>';
if (isset($mes->attachments[0]->path)) {
echo '<img src="' . $mes->attachments[0]->path . '" />';
}
echo '<p>' . $mes->body . '</p>';
?>
</div>
</div>
</div>
<hr class="hidden-xs" />
<div class="fitbit row">
<h1>Fitbit</h1>
</div>
</div>
</body>
</html>