10 defined(
'JPATH_PLATFORM') or die;
31 parent::__construct($options, $auth);
33 if (isset($this->auth) && !$this->auth->getOption(
'scope'))
35 $this->auth->setOption(
'scope',
'https://www.googleapis.com/auth/plus.me');
54 public function listComments($activityId, $fields = null, $max = 20, $order = null, $token = null, $alt = null)
56 if ($this->isAuthenticated())
58 $url = $this->getOption(
'api.url') .
'activities/' . $activityId .
'/comments';
63 $url .=
'?fields=' . $fields;
69 $url .= (strpos($url,
'?') ===
false) ?
'?maxResults=' :
'&maxResults=';
76 $url .= (strpos($url,
'?') ===
false) ?
'?orderBy=' :
'&orderBy=';
83 $url .= (strpos($url,
'?') ===
false) ?
'?pageToken=' :
'&pageToken=';
90 $url .= (strpos($url,
'?') ===
false) ?
'?alt=' :
'&alt=';
94 $jdata = $this->auth->query($url);
96 return json_decode($jdata->body,
true);
114 public function getComment($id, $fields = null)
116 if ($this->isAuthenticated())
118 $url = $this->getOption(
'api.url') .
'comments/' . $id;
123 $url .=
'?fields=' . $fields;
126 $jdata = $this->auth->query($url);
128 return json_decode($jdata->body,
true);