コード例 #1
0
 public function syncUser($userId)
 {
     $data = array("lftoken" => $this->buildLivefyreToken());
     $url = sprintf("%s/api/v3_0/user/%s/refresh", Domain::quill($this), $userId);
     $response = Client::POST($url, array(), $data);
     return $response->status_code == 200;
 }
コード例 #2
0
 private function invokeCollectionApi($method)
 {
     $uri = sprintf("%s/api/v3.0/site/%s/collection/%s/", Domain::quill($this), $this->getSite()->getData()->getId(), $method);
     $data = json_encode(array("articleId" => $this->getData()->getArticleId(), "collectionMeta" => $this->buildCollectionMetaToken(), "checksum" => $this->buildChecksum()));
     $headers = array("Content-Type" => "application/json", "Accepts" => "application/json");
     return Client::POST($uri . "?sync=1", $headers, $data);
 }
コード例 #3
0
 public function testQuill()
 {
     $quillUrlSsl = "https://" . $this->network->getNetworkName() . ".quill.fyre.co";
     $this->assertEquals($quillUrlSsl, Domain::quill($this->network));
     $this->assertEquals($quillUrlSsl, Domain::quill($this->site));
     $this->assertEquals($quillUrlSsl, Domain::quill($this->collection));
     $this->network->setSsl(false);
     $quillUrl = "http://quill." . $this->network->getNetworkName() . ".fyre.co";
     $this->assertEquals($quillUrl, Domain::quill($this->network));
     $this->assertEquals($quillUrl, Domain::quill($this->site));
     $this->assertEquals($quillUrl, Domain::quill($this->collection));
 }
コード例 #4
0
 private static function getTimelineUrl($core)
 {
     return sprintf(self::STREAM_URL, Domain::bootstrap($core)) . self::TIMELINE_PATH;
 }
コード例 #5
0
 public function getCollectionContent($articleId)
 {
     $url = sprintf("%s/bs3/%s/%s/%s/init", Domain::bootstrap($this), $this->_network->getName(), $this->_id, base64_encode($articleId));
     $response = Client::GET($url);
     return json_decode($response->body);
 }