-
Notifications
You must be signed in to change notification settings - Fork 0
/
fitbit_callback.php
41 lines (33 loc) · 1.1 KB
/
fitbit_callback.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
<?php
require_once('fitbitphp.php');
require_once('../config.php');
$fitbit = new FitBitPHP(
$GLOBALS['FitbitConsumerKey'],
$GLOBALS['FitbitConsumerSecret']
);
$fitbit->initSession('http://fredtrotter.com/oscon/fitbit_callback.php');
$oauth_secret = $fitbit->getOAuthSecret();
$oauth_token = $fitbit->getOAuthToken();
$fitbit->setResponseFormat('json');
echo "<h1>Got OAuth, copy these to config.php</h1>";
echo "<h3> OAuth Secret : '$oauth_secret' </h3>\n";
echo "<h3> OAuth Token : '$oauth_token' </h3>\n";
$profile = $fitbit->getProfile();
//$recent = $fitbit->getRecentActivities();
echo "<h1> Test data </h1>";
echo "<pre>";
print_r($profile);
echo "\n\n\n";
//print_r($recent);
echo "</pre>";
/*
getOAuthToken()
public function getOAuthSecret()
public function setUser($userId)
public function setMetric($metric)
public function getProfile()
public function updateProfile($gender = null, $birthday = null, $height = null, $nickname = null, $fullName = null, $timezone = null)
public function getActivities($date, $dateStr = null)
public function getRecentActivities()
*/
?>