diff options
author | Brion Vibber <brion@pobox.com> | 2010-09-23 17:55:13 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-09-28 07:44:24 -0700 |
commit | 8f438da254defa35d9e066fb29947da208d14319 (patch) | |
tree | a768c0be8268b60691e734b30f20b1a94396dd26 /plugins/YammerImport/lib/sn_yammerclient.php | |
parent | ae507b04856804acb41256a00a9cd2c8e7136c96 (diff) |
Ok, command-line workflow for YammerImportPlugin seems to mostly work, at least on tiny test site :D
Diffstat (limited to 'plugins/YammerImport/lib/sn_yammerclient.php')
-rw-r--r-- | plugins/YammerImport/lib/sn_yammerclient.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugins/YammerImport/lib/sn_yammerclient.php b/plugins/YammerImport/lib/sn_yammerclient.php index 830f9dabb..5da1cc5e7 100644 --- a/plugins/YammerImport/lib/sn_yammerclient.php +++ b/plugins/YammerImport/lib/sn_yammerclient.php @@ -104,7 +104,8 @@ class SN_YammerClient { $body = $this->fetchApi("api/v1/$method.json", $params); $data = json_decode($body, true); - if (!$data) { + if ($data === null) { + common_log(LOG_ERR, "Invalid JSON response from Yammer API: " . $body); throw new Exception("Invalid JSON response from Yammer API"); } return $data; @@ -161,7 +162,7 @@ class SN_YammerClient if ($this->token || $this->tokenSecret) { throw new Exception("Requesting a token, but already set up with a token"); } - $data = $this->fetch('oauth/request_token'); + $data = $this->fetchApi('oauth/request_token'); $arr = array(); parse_str($data, $arr); return $arr; @@ -176,7 +177,7 @@ class SN_YammerClient public function accessToken($verifier) { $this->verifier = $verifier; - $data = $this->fetch('oauth/access_token'); + $data = $this->fetchApi('oauth/access_token'); $this->verifier = null; $arr = array(); parse_str($data, $arr); |