Property | Type | Description | |
---|---|---|---|
$CURL_OPTIONS | Default cURL options. It doesn't appear that the UA matters, but authenticity, right? |
Method | Description | |
---|---|---|
decryptCBC ( data $data, string $key, string $iv ) : data | Decrypts blob data for stories. | |
decryptECB ( data $data ) : data | Decrypts blob data for standard images and videos. | |
encryptECB ( data $data ) : data | Encrypts blob data for standard images and videos. | |
get ( string $endpoint ) : data | Performs a GET request. Currently only used for story blobs. | |
hash ( string $first, string $second ) : string | Implementation of Snapchat's hashing algorithm. | |
isCompressed ( data $data ) : boolean | Checks to see if a blob looks like a compressed file. | |
isMedia ( data $data ) : boolean | Checks to see if a blob looks like a media file. | |
pad ( data $data, integer $blocksize = 16 ) : data | Pads data using PKCS5. | |
post ( string $endpoint, array $data, array $params, boolean $multipart = FALSE ) : mixed | Performs a POST request. Used for pretty much everything. | |
timestamp ( ) : integer | Returns the current timestamp. | |
unCompress ( data $data ) : array | Uncompress the blob and put the data into an Array. |
public decryptCBC ( data $data, string $key, string $iv ) : data | ||
$data | data | The data to decrypt. |
$key | string | The base64-encoded key. |
$iv | string | $iv The base64-encoded IV. |
return | data | The decrypted data. |
public decryptECB ( data $data ) : data | ||
$data | data | The data to decrypt. |
return | data | The decrypted data. |
public encryptECB ( data $data ) : data | ||
$data | data | The data to encrypt. |
return | data | The encrypted data. |
public isCompressed ( data $data ) : boolean | ||
$data | data | The blob data (or just the header). |
return | boolean | TRUE if the blob looks like a compressed file, FALSE otherwise. |
public post ( string $endpoint, array $data, array $params, boolean $multipart = FALSE ) : mixed | ||
$endpoint | string | The address of the resource being requested (e.g. '/update_snaps' or '/friend'). |
$data | array | An dictionary of values to send to the API. A request token is added automatically. |
$params | array | An array containing the parameters used to generate the request token. |
$multipart | boolean | If TRUE, sends the request as multipart/form-data. Defaults to FALSE. |
return | mixed | The data returned from the API (decoded if JSON). Returns FALSE if the request failed. |
public unCompress ( data $data ) : array | ||
$data | data | The blob data (or just the header). |
return | array | Array containing both file contents, or FALSE if couldn't extract. |