コード例 #1
0
ファイル: snapchat.php プロジェクト: sadiqhirani/php-snapchat
 /**
  * Updates the current user's email address.
  *
  * @param string $email
  *   The new email address.
  *
  * @return bool
  *   TRUE if successful, FALSE otherwise.
  */
 public function updateEmail($email)
 {
     // Make sure we're logged in and have a valid access token.
     if (!$this->auth_token || !$this->username) {
         return FALSE;
     }
     $timestamp = parent::timestamp();
     $result = parent::post('/settings', array('action' => 'updateEmail', 'email' => $email, 'timestamp' => $timestamp, 'username' => $this->username), array($this->auth_token, $timestamp));
     return isset($result->param) && $result->param == $email;
 }
コード例 #2
0
ファイル: snapchat.php プロジェクト: krew25/SC-API
 /**
  * Download the user's Snaptag, a jazzed up QR code with a ghost in the middle.
  *
  * @return data
  *   Snaptag data
  */
 public function getSnaptag()
 {
     $updates = $this->getUpdates();
     if (empty($updates)) {
         return FALSE;
     }
     $snaps = array();
     $qr = $updates['data']->updates_response->qr_path;
     $timestamp = parent::timestamp();
     $result = parent::post('/bq/snaptag_download', array('image' => $qr, 'timestamp' => $timestamp, 'username' => $this->username), array($this->auth_token, $timestamp), $multipart = false, $debug = $this->debug);
     return $result;
 }
コード例 #3
0
ファイル: snapchat.php プロジェクト: k1bb1/SC-API
 /**
  * Set/update your location for geofilters, weather info, and local stories.
  *
  * @param int $lat
  *   Latitude.
  *
  * @param int $lon
  *   Longitude.
  *
  * @param int $acc
  *   Accuracy in meters.
  *
  * @return json array
  *   Returns a JSON array with geofilters, local our stories, weather, and lens filters.
  */
 public function setLocation($lat, $lon, $acc)
 {
     $timestamp = parent::timestamp();
     $result = parent::post('/loq/loc_data', array('timestamp' => $timestamp, 'lat' => $lat, 'long' => $lon, 'loc_accuracy_in_meters' => $acc, 'checksums_dict' => '{}', 'username' => $this->username), array($this->auth_token, $timestamp), $multipart = false, $debug = $this->debug);
     return $result;
 }