public function build()
 {
     $data = ['email' => $this->email, 'pass' => $this->password];
     $request = new CURLRequest(self::REQ_BASEURL, self::REQ_PATH, 'POST', null, $data, true);
     $result = $request->execute();
     preg_match('%Set-Cookie: ([^;]+);%', $result, $cookieData);
     $cookies = $cookieData[1];
     $request = new CURLRequest(self::REQ_BASEURL, self::REQ_PATH, 'POST', $cookies, $data, true);
     $result = $request->execute();
     preg_match_all('%Set-Cookie: ([^;]+);%', $result, $cookieData);
     $cookies = implode(';', $cookieData[1]);
     return $cookies;
 }
 /**
  * Posts a message to Gist.
  *
  * @param object $entity The post entity.
  *
  * @return string The Gist URL.
  */
 private function gistifyMessage($entity)
 {
     $data = json_encode(['public' => true, 'description' => 'PHPWorldWide: Auto-generated snippet owned by ' . $entity->getAuthor(), 'files' => ['snippet.php' => ['content' => $entity->getMessage()]]]);
     $headers = ['Content-Type' => 'application/json', 'Content-Length' => strlen($data)];
     $baseUrl = 'https://api.github.com';
     $request = new CURLRequest($baseUrl, '/gists', 'POST', null, $data, false, $headers);
     $response = json_decode($request->execute());
     return $response->html_url;
 }