PHP 클래스 SnapchatAgent

파일 보기 프로젝트 열기: jorgenphi/php-snapchat 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$CURL_OPTIONS Default cURL options. It doesn't appear that the UA matters, but authenticity, right?

공개 메소드들

메소드 설명
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.

메소드 상세

decryptCBC() 공개 메소드

Decrypts blob data for stories.
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.
리턴 data The decrypted data.

decryptECB() 공개 메소드

Decrypts blob data for standard images and videos.
public decryptECB ( data $data ) : data
$data data The data to decrypt.
리턴 data The decrypted data.

encryptECB() 공개 메소드

Encrypts blob data for standard images and videos.
public encryptECB ( data $data ) : data
$data data The data to encrypt.
리턴 data The encrypted data.

get() 공개 메소드

Performs a GET request. Currently only used for story blobs.
public get ( string $endpoint ) : data
$endpoint string The address of the resource being requested (e.g. '/story_blob' or '/story_thumbnail').
리턴 data The retrieved data.

hash() 공개 메소드

Implementation of Snapchat's hashing algorithm.
public hash ( string $first, string $second ) : string
$first string The first value to use in the hash.
$second string The second value to use in the hash.
리턴 string The generated hash.

isCompressed() 공개 메소드

Checks to see if a blob looks like a compressed file.
public isCompressed ( data $data ) : boolean
$data data The blob data (or just the header).
리턴 boolean TRUE if the blob looks like a compressed file, FALSE otherwise.

isMedia() 공개 메소드

Checks to see if a blob looks like a media file.
public isMedia ( data $data ) : boolean
$data data The blob data (or just the header).
리턴 boolean TRUE if the blob looks like a media file, FALSE otherwise.

pad() 공개 메소드

Pads data using PKCS5.
public pad ( data $data, integer $blocksize = 16 ) : data
$data data The data to be padded.
$blocksize integer The block size to pad to. Defaults to 16.
리턴 data The padded data.

post() 공개 메소드

Performs a POST request. Used for pretty much everything.
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.
리턴 mixed The data returned from the API (decoded if JSON). Returns FALSE if the request failed.

timestamp() 공개 메소드

Returns the current timestamp.
public timestamp ( ) : integer
리턴 integer The current timestamp, expressed in milliseconds since epoch.

unCompress() 공개 메소드

Array( overlay~zip-CE6F660A-4A9F-4BD6-8183-245C9C75B8A0 => overlay_file_data, media~zip-CE6F660A-4A9F-4BD6-8183-245C9C75B8A0 => m4v_file_data )
public unCompress ( data $data ) : array
$data data The blob data (or just the header).
리턴 array Array containing both file contents, or FALSE if couldn't extract.

프로퍼티 상세

$CURL_OPTIONS 공개적으로 정적으로 프로퍼티

Default cURL options. It doesn't appear that the UA matters, but authenticity, right?
public static $CURL_OPTIONS