├── README.md ├── composer.json ├── composer.lock ├── test.php └── vendor ├── autoload.php ├── composer ├── ClassLoader.php ├── LICENSE ├── autoload_classmap.php ├── autoload_files.php ├── autoload_namespaces.php ├── autoload_psr4.php ├── autoload_real.php ├── autoload_static.php └── installed.json ├── guzzlehttp ├── guzzle │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── UPGRADING.md │ ├── composer.json │ └── src │ │ ├── Client.php │ │ ├── ClientInterface.php │ │ ├── Cookie │ │ ├── CookieJar.php │ │ ├── CookieJarInterface.php │ │ ├── FileCookieJar.php │ │ ├── SessionCookieJar.php │ │ └── SetCookie.php │ │ ├── Exception │ │ ├── BadResponseException.php │ │ ├── ClientException.php │ │ ├── ConnectException.php │ │ ├── GuzzleException.php │ │ ├── RequestException.php │ │ ├── SeekException.php │ │ ├── ServerException.php │ │ ├── TooManyRedirectsException.php │ │ └── TransferException.php │ │ ├── Handler │ │ ├── CurlFactory.php │ │ ├── CurlFactoryInterface.php │ │ ├── CurlHandler.php │ │ ├── CurlMultiHandler.php │ │ ├── EasyHandle.php │ │ ├── MockHandler.php │ │ ├── Proxy.php │ │ └── StreamHandler.php │ │ ├── HandlerStack.php │ │ ├── MessageFormatter.php │ │ ├── Middleware.php │ │ ├── Pool.php │ │ ├── PrepareBodyMiddleware.php │ │ ├── RedirectMiddleware.php │ │ ├── RequestOptions.php │ │ ├── RetryMiddleware.php │ │ ├── TransferStats.php │ │ ├── UriTemplate.php │ │ ├── functions.php │ │ └── functions_include.php ├── promises │ ├── CHANGELOG.md │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── composer.json │ └── src │ │ ├── AggregateException.php │ │ ├── CancellationException.php │ │ ├── Coroutine.php │ │ ├── EachPromise.php │ │ ├── FulfilledPromise.php │ │ ├── Promise.php │ │ ├── PromiseInterface.php │ │ ├── PromisorInterface.php │ │ ├── RejectedPromise.php │ │ ├── RejectionException.php │ │ ├── TaskQueue.php │ │ ├── TaskQueueInterface.php │ │ ├── functions.php │ │ └── functions_include.php └── psr7 │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ ├── AppendStream.php │ ├── BufferStream.php │ ├── CachingStream.php │ ├── DroppingStream.php │ ├── FnStream.php │ ├── InflateStream.php │ ├── LazyOpenStream.php │ ├── LimitStream.php │ ├── MessageTrait.php │ ├── MultipartStream.php │ ├── NoSeekStream.php │ ├── PumpStream.php │ ├── Request.php │ ├── Response.php │ ├── Rfc7230.php │ ├── ServerRequest.php │ ├── Stream.php │ ├── StreamDecoratorTrait.php │ ├── StreamWrapper.php │ ├── UploadedFile.php │ ├── Uri.php │ ├── UriNormalizer.php │ ├── UriResolver.php │ ├── functions.php │ └── functions_include.php ├── netresearch └── jsonmapper │ ├── .travis.yml │ ├── LICENSE │ ├── composer.json │ └── src │ ├── JsonMapper.php │ └── JsonMapper │ └── Exception.php ├── picaboooo └── snapchatsdk │ ├── .gitignore │ ├── README.md │ ├── composer.json │ ├── examples │ ├── assets │ │ └── snapchat.png │ ├── download │ │ ├── captcha │ │ │ └── deleteme.txt │ │ ├── snaps │ │ │ └── deleteme.txt │ │ ├── snaptag │ │ │ └── deleteme.txt │ │ └── stories │ │ │ └── deleteme.txt │ ├── example.loginAndAddFriend.php │ ├── example.loginAndDownloadMyStories.php │ ├── example.loginAndDownloadSnapTag.php │ ├── example.loginAndDownloadStoriesByUsername.php │ ├── example.loginAndDownloadUnviewedSnaps.php │ ├── example.loginAndFindFriendFriends.php │ ├── example.loginAndMarkUnviewedSnapsViewed.php │ ├── example.loginAndSendSnap.php │ ├── example.loginAndViewFriends.php │ ├── example.other.php │ ├── login_2fa.php │ └── register.php │ └── src │ ├── Picaboooo │ ├── PicabooooClient.php │ └── PicabooooException.php │ └── Snapchat │ ├── API │ ├── Constants.php │ ├── Framework │ │ ├── Request.php │ │ ├── RequestFile.php │ │ └── Response.php │ ├── Request │ │ ├── AllUpdatesRequest.php │ │ ├── AuthStoryBlobRequest.php │ │ ├── AuthenticatedBaseRequest.php │ │ ├── BaseRequest.php │ │ ├── BlobRequest.php │ │ ├── ClearConversationRequest.php │ │ ├── ClearFeedRequest.php │ │ ├── ConversationAuthTokenRequest.php │ │ ├── ConversationPostMessagesRequest.php │ │ ├── ConversationRequest.php │ │ ├── ConversationsRequest.php │ │ ├── DeleteStoryRequest.php │ │ ├── DeviceTokenRequest.php │ │ ├── FindFriendsRequest.php │ │ ├── FriendRequest.php │ │ ├── GetCaptchaRequest.php │ │ ├── LoginRequest.php │ │ ├── LogoutRequest.php │ │ ├── Model │ │ │ ├── SendMediaPayload.php │ │ │ └── UploadMediaPayload.php │ │ ├── OtpRequest.php │ │ ├── PhoneVerifyRequest.php │ │ ├── RegisterRequest.php │ │ ├── RegisterUsernameRequest.php │ │ ├── SendMediaRequest.php │ │ ├── SnapTagRequest.php │ │ ├── SolveCaptchaRequest.php │ │ ├── StoriesRequest.php │ │ ├── UpdateSnapsRequest.php │ │ ├── UpdateStoriesRequest.php │ │ └── UploadMediaRequest.php │ └── Response │ │ ├── AllUpdatesResponse.php │ │ ├── BaseResponse.php │ │ ├── ConversationAuthTokenResponse.php │ │ ├── ConversationResponse.php │ │ ├── ConversationsResponse.php │ │ ├── DeviceTokenResponse.php │ │ ├── FindFriendsResponse.php │ │ ├── FriendResponse.php │ │ ├── FriendsResponse.php │ │ ├── LoginResponse.php │ │ ├── Model │ │ ├── AddedFriend.php │ │ ├── ChatMessage.php │ │ ├── ChatMessageBody.php │ │ ├── ChatMessageHeader.php │ │ ├── ChatMessageMedia.php │ │ ├── Conversation.php │ │ ├── ConversationMessages.php │ │ ├── ConversationState.php │ │ ├── Friend.php │ │ ├── FriendStories.php │ │ ├── FriendStoryContainer.php │ │ ├── GatewayAuthToken.php │ │ ├── Message.php │ │ ├── MessagingAuth.php │ │ ├── MessagingGatewayInfo.php │ │ ├── MyStory.php │ │ ├── Snap.php │ │ ├── Story.php │ │ ├── StoryExtras.php │ │ ├── StoryNote.php │ │ └── VerificationNeeded.php │ │ ├── PhoneVerifyResponse.php │ │ ├── RegisterUsernameResponse.php │ │ ├── SnapTagResponse.php │ │ ├── SolveCaptchaResponse.php │ │ ├── StoriesResponse.php │ │ └── UpdatesResponse.php │ ├── Crypto │ ├── DeviceToken.php │ └── StoryCrypto.php │ ├── Exceptions │ └── SnapchatException.php │ ├── Model │ ├── Captcha.php │ └── MediaPath.php │ ├── SnapchatClient.php │ └── Util │ ├── FileUtil.php │ ├── RequestUtil.php │ └── StringUtil.php ├── psr └── http-message │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── composer.json │ └── src │ ├── MessageInterface.php │ ├── RequestInterface.php │ ├── ResponseInterface.php │ ├── ServerRequestInterface.php │ ├── StreamInterface.php │ ├── UploadedFileInterface.php │ └── UriInterface.php └── ralouphie └── getallheaders ├── LICENSE ├── README.md ├── composer.json └── src └── getallheaders.php /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "require": { 3 | "picaboooo/snapchatsdk": "^1.0" 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test.php: -------------------------------------------------------------------------------- 1 | login("sunil.techwob", "***********"); 12 | 13 | // Add Friend 14 | $snapchat->addFriend("pravinustad19"); 15 | 16 | } catch (Exception $e) { 17 | // Something went wrong... 18 | echo $e->getMessage() . "\n"; 19 | } 20 | -------------------------------------------------------------------------------- /vendor/autoload.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php', 10 | 'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php', 11 | 'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php', 12 | '37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php', 13 | ); 14 | -------------------------------------------------------------------------------- /vendor/composer/autoload_namespaces.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/netresearch/jsonmapper/src'), 10 | ); 11 | -------------------------------------------------------------------------------- /vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/picaboooo/snapchatsdk/src/Snapchat'), 10 | 'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'), 11 | 'Picaboooo\\' => array($vendorDir . '/picaboooo/snapchatsdk/src/Picaboooo'), 12 | 'GuzzleHttp\\Psr7\\' => array($vendorDir . '/guzzlehttp/psr7/src'), 13 | 'GuzzleHttp\\Promise\\' => array($vendorDir . '/guzzlehttp/promises/src'), 14 | 'GuzzleHttp\\' => array($vendorDir . '/guzzlehttp/guzzle/src'), 15 | ); 16 | -------------------------------------------------------------------------------- /vendor/composer/autoload_real.php: -------------------------------------------------------------------------------- 1 | = 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded()); 27 | if ($useStaticLoader) { 28 | require_once __DIR__ . '/autoload_static.php'; 29 | 30 | call_user_func(\Composer\Autoload\ComposerStaticInit34b3a6aaf444a64e6e0fd18a480ea4a0::getInitializer($loader)); 31 | } else { 32 | $map = require __DIR__ . '/autoload_namespaces.php'; 33 | foreach ($map as $namespace => $path) { 34 | $loader->set($namespace, $path); 35 | } 36 | 37 | $map = require __DIR__ . '/autoload_psr4.php'; 38 | foreach ($map as $namespace => $path) { 39 | $loader->setPsr4($namespace, $path); 40 | } 41 | 42 | $classMap = require __DIR__ . '/autoload_classmap.php'; 43 | if ($classMap) { 44 | $loader->addClassMap($classMap); 45 | } 46 | } 47 | 48 | $loader->register(true); 49 | 50 | if ($useStaticLoader) { 51 | $includeFiles = Composer\Autoload\ComposerStaticInit34b3a6aaf444a64e6e0fd18a480ea4a0::$files; 52 | } else { 53 | $includeFiles = require __DIR__ . '/autoload_files.php'; 54 | } 55 | foreach ($includeFiles as $fileIdentifier => $file) { 56 | composerRequire34b3a6aaf444a64e6e0fd18a480ea4a0($fileIdentifier, $file); 57 | } 58 | 59 | return $loader; 60 | } 61 | } 62 | 63 | function composerRequire34b3a6aaf444a64e6e0fd18a480ea4a0($fileIdentifier, $file) 64 | { 65 | if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) { 66 | require $file; 67 | 68 | $GLOBALS['__composer_autoload_files'][$fileIdentifier] = true; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /vendor/composer/autoload_static.php: -------------------------------------------------------------------------------- 1 | __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php', 11 | 'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php', 12 | 'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php', 13 | '37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php', 14 | ); 15 | 16 | public static $prefixLengthsPsr4 = array ( 17 | 'S' => 18 | array ( 19 | 'Snapchat\\' => 9, 20 | ), 21 | 'P' => 22 | array ( 23 | 'Psr\\Http\\Message\\' => 17, 24 | 'Picaboooo\\' => 10, 25 | ), 26 | 'G' => 27 | array ( 28 | 'GuzzleHttp\\Psr7\\' => 16, 29 | 'GuzzleHttp\\Promise\\' => 19, 30 | 'GuzzleHttp\\' => 11, 31 | ), 32 | ); 33 | 34 | public static $prefixDirsPsr4 = array ( 35 | 'Snapchat\\' => 36 | array ( 37 | 0 => __DIR__ . '/..' . '/picaboooo/snapchatsdk/src/Snapchat', 38 | ), 39 | 'Psr\\Http\\Message\\' => 40 | array ( 41 | 0 => __DIR__ . '/..' . '/psr/http-message/src', 42 | ), 43 | 'Picaboooo\\' => 44 | array ( 45 | 0 => __DIR__ . '/..' . '/picaboooo/snapchatsdk/src/Picaboooo', 46 | ), 47 | 'GuzzleHttp\\Psr7\\' => 48 | array ( 49 | 0 => __DIR__ . '/..' . '/guzzlehttp/psr7/src', 50 | ), 51 | 'GuzzleHttp\\Promise\\' => 52 | array ( 53 | 0 => __DIR__ . '/..' . '/guzzlehttp/promises/src', 54 | ), 55 | 'GuzzleHttp\\' => 56 | array ( 57 | 0 => __DIR__ . '/..' . '/guzzlehttp/guzzle/src', 58 | ), 59 | ); 60 | 61 | public static $prefixesPsr0 = array ( 62 | 'J' => 63 | array ( 64 | 'JsonMapper' => 65 | array ( 66 | 0 => __DIR__ . '/..' . '/netresearch/jsonmapper/src', 67 | ), 68 | ), 69 | ); 70 | 71 | public static function getInitializer(ClassLoader $loader) 72 | { 73 | return \Closure::bind(function () use ($loader) { 74 | $loader->prefixLengthsPsr4 = ComposerStaticInit34b3a6aaf444a64e6e0fd18a480ea4a0::$prefixLengthsPsr4; 75 | $loader->prefixDirsPsr4 = ComposerStaticInit34b3a6aaf444a64e6e0fd18a480ea4a0::$prefixDirsPsr4; 76 | $loader->prefixesPsr0 = ComposerStaticInit34b3a6aaf444a64e6e0fd18a480ea4a0::$prefixesPsr0; 77 | 78 | }, null, ClassLoader::class); 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2018 Michael Dowling, https://github.com/mtdowling 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/README.md: -------------------------------------------------------------------------------- 1 | Guzzle, PHP HTTP client 2 | ======================= 3 | 4 | [![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases) 5 | [![Build Status](https://img.shields.io/travis/guzzle/guzzle.svg?style=flat-square)](https://travis-ci.org/guzzle/guzzle) 6 | [![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle) 7 | 8 | Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and 9 | trivial to integrate with web services. 10 | 11 | - Simple interface for building query strings, POST requests, streaming large 12 | uploads, streaming large downloads, using HTTP cookies, uploading JSON data, 13 | etc... 14 | - Can send both synchronous and asynchronous requests using the same interface. 15 | - Uses PSR-7 interfaces for requests, responses, and streams. This allows you 16 | to utilize other PSR-7 compatible libraries with Guzzle. 17 | - Abstracts away the underlying HTTP transport, allowing you to write 18 | environment and transport agnostic code; i.e., no hard dependency on cURL, 19 | PHP streams, sockets, or non-blocking event loops. 20 | - Middleware system allows you to augment and compose client behavior. 21 | 22 | ```php 23 | $client = new \GuzzleHttp\Client(); 24 | $res = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle'); 25 | echo $res->getStatusCode(); 26 | // 200 27 | echo $res->getHeaderLine('content-type'); 28 | // 'application/json; charset=utf8' 29 | echo $res->getBody(); 30 | // '{"id": 1420053, "name": "guzzle", ...}' 31 | 32 | // Send an asynchronous request. 33 | $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org'); 34 | $promise = $client->sendAsync($request)->then(function ($response) { 35 | echo 'I completed! ' . $response->getBody(); 36 | }); 37 | $promise->wait(); 38 | ``` 39 | 40 | ## Help and docs 41 | 42 | - [Documentation](http://guzzlephp.org/) 43 | - [Stack Overflow](http://stackoverflow.com/questions/tagged/guzzle) 44 | - [Gitter](https://gitter.im/guzzle/guzzle) 45 | 46 | 47 | ## Installing Guzzle 48 | 49 | The recommended way to install Guzzle is through 50 | [Composer](http://getcomposer.org). 51 | 52 | ```bash 53 | # Install Composer 54 | curl -sS https://getcomposer.org/installer | php 55 | ``` 56 | 57 | Next, run the Composer command to install the latest stable version of Guzzle: 58 | 59 | ```bash 60 | php composer.phar require guzzlehttp/guzzle 61 | ``` 62 | 63 | After installing, you need to require Composer's autoloader: 64 | 65 | ```php 66 | require 'vendor/autoload.php'; 67 | ``` 68 | 69 | You can then later update Guzzle using composer: 70 | 71 | ```bash 72 | composer.phar update 73 | ``` 74 | 75 | 76 | ## Version Guidance 77 | 78 | | Version | Status | Packagist | Namespace | Repo | Docs | PSR-7 | PHP Version | 79 | |---------|------------|---------------------|--------------|---------------------|---------------------|-------|-------------| 80 | | 3.x | EOL | `guzzle/guzzle` | `Guzzle` | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No | >= 5.3.3 | 81 | | 4.x | EOL | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A | No | >= 5.4 | 82 | | 5.x | Maintained | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No | >= 5.4 | 83 | | 6.x | Latest | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes | >= 5.5 | 84 | 85 | [guzzle-3-repo]: https://github.com/guzzle/guzzle3 86 | [guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x 87 | [guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3 88 | [guzzle-6-repo]: https://github.com/guzzle/guzzle 89 | [guzzle-3-docs]: http://guzzle3.readthedocs.org/en/latest/ 90 | [guzzle-5-docs]: http://guzzle.readthedocs.org/en/5.3/ 91 | [guzzle-6-docs]: http://guzzle.readthedocs.org/en/latest/ 92 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/guzzle", 3 | "type": "library", 4 | "description": "Guzzle is a PHP HTTP client library", 5 | "keywords": ["framework", "http", "rest", "web service", "curl", "client", "HTTP client"], 6 | "homepage": "http://guzzlephp.org/", 7 | "license": "MIT", 8 | "authors": [ 9 | { 10 | "name": "Michael Dowling", 11 | "email": "mtdowling@gmail.com", 12 | "homepage": "https://github.com/mtdowling" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.5", 17 | "guzzlehttp/psr7": "^1.4", 18 | "guzzlehttp/promises": "^1.0" 19 | }, 20 | "require-dev": { 21 | "ext-curl": "*", 22 | "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", 23 | "psr/log": "^1.0" 24 | }, 25 | "autoload": { 26 | "files": ["src/functions_include.php"], 27 | "psr-4": { 28 | "GuzzleHttp\\": "src/" 29 | } 30 | }, 31 | "autoload-dev": { 32 | "psr-4": { 33 | "GuzzleHttp\\Tests\\": "tests/" 34 | } 35 | }, 36 | "suggest": { 37 | "psr/log": "Required for using the Log middleware" 38 | }, 39 | "extra": { 40 | "branch-alias": { 41 | "dev-master": "6.3-dev" 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/ClientInterface.php: -------------------------------------------------------------------------------- 1 | filename = $cookieFile; 27 | $this->storeSessionCookies = $storeSessionCookies; 28 | 29 | if (file_exists($cookieFile)) { 30 | $this->load($cookieFile); 31 | } 32 | } 33 | 34 | /** 35 | * Saves the file when shutting down 36 | */ 37 | public function __destruct() 38 | { 39 | $this->save($this->filename); 40 | } 41 | 42 | /** 43 | * Saves the cookies to a file. 44 | * 45 | * @param string $filename File to save 46 | * @throws \RuntimeException if the file cannot be found or created 47 | */ 48 | public function save($filename) 49 | { 50 | $json = []; 51 | foreach ($this as $cookie) { 52 | /** @var SetCookie $cookie */ 53 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { 54 | $json[] = $cookie->toArray(); 55 | } 56 | } 57 | 58 | $jsonStr = \GuzzleHttp\json_encode($json); 59 | if (false === file_put_contents($filename, $jsonStr)) { 60 | throw new \RuntimeException("Unable to save file {$filename}"); 61 | } 62 | } 63 | 64 | /** 65 | * Load cookies from a JSON formatted file. 66 | * 67 | * Old cookies are kept unless overwritten by newly loaded ones. 68 | * 69 | * @param string $filename Cookie file to load. 70 | * @throws \RuntimeException if the file cannot be loaded. 71 | */ 72 | public function load($filename) 73 | { 74 | $json = file_get_contents($filename); 75 | if (false === $json) { 76 | throw new \RuntimeException("Unable to load file {$filename}"); 77 | } elseif ($json === '') { 78 | return; 79 | } 80 | 81 | $data = \GuzzleHttp\json_decode($json, true); 82 | if (is_array($data)) { 83 | foreach (json_decode($json, true) as $cookie) { 84 | $this->setCookie(new SetCookie($cookie)); 85 | } 86 | } elseif (strlen($data)) { 87 | throw new \RuntimeException("Invalid cookie file: {$filename}"); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Cookie/SessionCookieJar.php: -------------------------------------------------------------------------------- 1 | sessionKey = $sessionKey; 26 | $this->storeSessionCookies = $storeSessionCookies; 27 | $this->load(); 28 | } 29 | 30 | /** 31 | * Saves cookies to session when shutting down 32 | */ 33 | public function __destruct() 34 | { 35 | $this->save(); 36 | } 37 | 38 | /** 39 | * Save cookies to the client session 40 | */ 41 | public function save() 42 | { 43 | $json = []; 44 | foreach ($this as $cookie) { 45 | /** @var SetCookie $cookie */ 46 | if (CookieJar::shouldPersist($cookie, $this->storeSessionCookies)) { 47 | $json[] = $cookie->toArray(); 48 | } 49 | } 50 | 51 | $_SESSION[$this->sessionKey] = json_encode($json); 52 | } 53 | 54 | /** 55 | * Load the contents of the client session into the data array 56 | */ 57 | protected function load() 58 | { 59 | if (!isset($_SESSION[$this->sessionKey])) { 60 | return; 61 | } 62 | $data = json_decode($_SESSION[$this->sessionKey], true); 63 | if (is_array($data)) { 64 | foreach ($data as $cookie) { 65 | $this->setCookie(new SetCookie($cookie)); 66 | } 67 | } elseif (strlen($data)) { 68 | throw new \RuntimeException("Invalid cookie data"); 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/BadResponseException.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 16 | $msg = $msg ?: 'Could not seek the stream to position ' . $pos; 17 | parent::__construct($msg); 18 | } 19 | 20 | /** 21 | * @return StreamInterface 22 | */ 23 | public function getStream() 24 | { 25 | return $this->stream; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Exception/ServerException.php: -------------------------------------------------------------------------------- 1 | factory = isset($options['handle_factory']) 29 | ? $options['handle_factory'] 30 | : new CurlFactory(3); 31 | } 32 | 33 | public function __invoke(RequestInterface $request, array $options) 34 | { 35 | if (isset($options['delay'])) { 36 | usleep($options['delay'] * 1000); 37 | } 38 | 39 | $easy = $this->factory->create($request, $options); 40 | curl_exec($easy->handle); 41 | $easy->errno = curl_errno($easy->handle); 42 | 43 | return CurlFactory::finish($this, $easy, $this->factory); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Handler/EasyHandle.php: -------------------------------------------------------------------------------- 1 | headers)) { 48 | throw new \RuntimeException('No headers have been received'); 49 | } 50 | 51 | // HTTP-version SP status-code SP reason-phrase 52 | $startLine = explode(' ', array_shift($this->headers), 3); 53 | $headers = \GuzzleHttp\headers_from_lines($this->headers); 54 | $normalizedKeys = \GuzzleHttp\normalize_header_keys($headers); 55 | 56 | if (!empty($this->options['decode_content']) 57 | && isset($normalizedKeys['content-encoding']) 58 | ) { 59 | $headers['x-encoded-content-encoding'] 60 | = $headers[$normalizedKeys['content-encoding']]; 61 | unset($headers[$normalizedKeys['content-encoding']]); 62 | if (isset($normalizedKeys['content-length'])) { 63 | $headers['x-encoded-content-length'] 64 | = $headers[$normalizedKeys['content-length']]; 65 | 66 | $bodyLength = (int) $this->sink->getSize(); 67 | if ($bodyLength) { 68 | $headers[$normalizedKeys['content-length']] = $bodyLength; 69 | } else { 70 | unset($headers[$normalizedKeys['content-length']]); 71 | } 72 | } 73 | } 74 | 75 | // Attach a response to the easy handle with the parsed headers. 76 | $this->response = new Response( 77 | $startLine[1], 78 | $headers, 79 | $this->sink, 80 | substr($startLine[0], 5), 81 | isset($startLine[2]) ? (string) $startLine[2] : null 82 | ); 83 | } 84 | 85 | public function __get($name) 86 | { 87 | $msg = $name === 'handle' 88 | ? 'The EasyHandle has been released' 89 | : 'Invalid property: ' . $name; 90 | throw new \BadMethodCallException($msg); 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/Handler/Proxy.php: -------------------------------------------------------------------------------- 1 | nextHandler = $nextHandler; 23 | } 24 | 25 | /** 26 | * @param RequestInterface $request 27 | * @param array $options 28 | * 29 | * @return PromiseInterface 30 | */ 31 | public function __invoke(RequestInterface $request, array $options) 32 | { 33 | $fn = $this->nextHandler; 34 | 35 | // Don't do anything if the request has no body. 36 | if ($request->getBody()->getSize() === 0) { 37 | return $fn($request, $options); 38 | } 39 | 40 | $modify = []; 41 | 42 | // Add a default content-type if possible. 43 | if (!$request->hasHeader('Content-Type')) { 44 | if ($uri = $request->getBody()->getMetadata('uri')) { 45 | if ($type = Psr7\mimetype_from_filename($uri)) { 46 | $modify['set_headers']['Content-Type'] = $type; 47 | } 48 | } 49 | } 50 | 51 | // Add a default content-length or transfer-encoding header. 52 | if (!$request->hasHeader('Content-Length') 53 | && !$request->hasHeader('Transfer-Encoding') 54 | ) { 55 | $size = $request->getBody()->getSize(); 56 | if ($size !== null) { 57 | $modify['set_headers']['Content-Length'] = $size; 58 | } else { 59 | $modify['set_headers']['Transfer-Encoding'] = 'chunked'; 60 | } 61 | } 62 | 63 | // Add the expect header if needed. 64 | $this->addExpectHeader($request, $options, $modify); 65 | 66 | return $fn(Psr7\modify_request($request, $modify), $options); 67 | } 68 | 69 | private function addExpectHeader( 70 | RequestInterface $request, 71 | array $options, 72 | array &$modify 73 | ) { 74 | // Determine if the Expect header should be used 75 | if ($request->hasHeader('Expect')) { 76 | return; 77 | } 78 | 79 | $expect = isset($options['expect']) ? $options['expect'] : null; 80 | 81 | // Return if disabled or if you're not using HTTP/1.1 or HTTP/2.0 82 | if ($expect === false || $request->getProtocolVersion() < 1.1) { 83 | return; 84 | } 85 | 86 | // The expect header is unconditionally enabled 87 | if ($expect === true) { 88 | $modify['set_headers']['Expect'] = '100-Continue'; 89 | return; 90 | } 91 | 92 | // By default, send the expect header when the payload is > 1mb 93 | if ($expect === null) { 94 | $expect = 1048576; 95 | } 96 | 97 | // Always add if the body cannot be rewound, the size cannot be 98 | // determined, or the size is greater than the cutoff threshold 99 | $body = $request->getBody(); 100 | $size = $body->getSize(); 101 | 102 | if ($size === null || $size >= (int) $expect || !$body->isSeekable()) { 103 | $modify['set_headers']['Expect'] = '100-Continue'; 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/RetryMiddleware.php: -------------------------------------------------------------------------------- 1 | decider = $decider; 38 | $this->nextHandler = $nextHandler; 39 | $this->delay = $delay ?: __CLASS__ . '::exponentialDelay'; 40 | } 41 | 42 | /** 43 | * Default exponential backoff delay function. 44 | * 45 | * @param $retries 46 | * 47 | * @return int 48 | */ 49 | public static function exponentialDelay($retries) 50 | { 51 | return (int) pow(2, $retries - 1); 52 | } 53 | 54 | /** 55 | * @param RequestInterface $request 56 | * @param array $options 57 | * 58 | * @return PromiseInterface 59 | */ 60 | public function __invoke(RequestInterface $request, array $options) 61 | { 62 | if (!isset($options['retries'])) { 63 | $options['retries'] = 0; 64 | } 65 | 66 | $fn = $this->nextHandler; 67 | return $fn($request, $options) 68 | ->then( 69 | $this->onFulfilled($request, $options), 70 | $this->onRejected($request, $options) 71 | ); 72 | } 73 | 74 | private function onFulfilled(RequestInterface $req, array $options) 75 | { 76 | return function ($value) use ($req, $options) { 77 | if (!call_user_func( 78 | $this->decider, 79 | $options['retries'], 80 | $req, 81 | $value, 82 | null 83 | )) { 84 | return $value; 85 | } 86 | return $this->doRetry($req, $options, $value); 87 | }; 88 | } 89 | 90 | private function onRejected(RequestInterface $req, array $options) 91 | { 92 | return function ($reason) use ($req, $options) { 93 | if (!call_user_func( 94 | $this->decider, 95 | $options['retries'], 96 | $req, 97 | null, 98 | $reason 99 | )) { 100 | return \GuzzleHttp\Promise\rejection_for($reason); 101 | } 102 | return $this->doRetry($req, $options); 103 | }; 104 | } 105 | 106 | private function doRetry(RequestInterface $request, array $options, ResponseInterface $response = null) 107 | { 108 | $options['delay'] = call_user_func($this->delay, ++$options['retries'], $response); 109 | 110 | return $this($request, $options); 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/TransferStats.php: -------------------------------------------------------------------------------- 1 | request = $request; 35 | $this->response = $response; 36 | $this->transferTime = $transferTime; 37 | $this->handlerErrorData = $handlerErrorData; 38 | $this->handlerStats = $handlerStats; 39 | } 40 | 41 | /** 42 | * @return RequestInterface 43 | */ 44 | public function getRequest() 45 | { 46 | return $this->request; 47 | } 48 | 49 | /** 50 | * Returns the response that was received (if any). 51 | * 52 | * @return ResponseInterface|null 53 | */ 54 | public function getResponse() 55 | { 56 | return $this->response; 57 | } 58 | 59 | /** 60 | * Returns true if a response was received. 61 | * 62 | * @return bool 63 | */ 64 | public function hasResponse() 65 | { 66 | return $this->response !== null; 67 | } 68 | 69 | /** 70 | * Gets handler specific error data. 71 | * 72 | * This might be an exception, a integer representing an error code, or 73 | * anything else. Relying on this value assumes that you know what handler 74 | * you are using. 75 | * 76 | * @return mixed 77 | */ 78 | public function getHandlerErrorData() 79 | { 80 | return $this->handlerErrorData; 81 | } 82 | 83 | /** 84 | * Get the effective URI the request was sent to. 85 | * 86 | * @return UriInterface 87 | */ 88 | public function getEffectiveUri() 89 | { 90 | return $this->request->getUri(); 91 | } 92 | 93 | /** 94 | * Get the estimated time the request was being transferred by the handler. 95 | * 96 | * @return float Time in seconds. 97 | */ 98 | public function getTransferTime() 99 | { 100 | return $this->transferTime; 101 | } 102 | 103 | /** 104 | * Gets an array of all of the handler specific transfer data. 105 | * 106 | * @return array 107 | */ 108 | public function getHandlerStats() 109 | { 110 | return $this->handlerStats; 111 | } 112 | 113 | /** 114 | * Get a specific handler statistic from the handler by name. 115 | * 116 | * @param string $stat Handler specific transfer stat to retrieve. 117 | * 118 | * @return mixed|null 119 | */ 120 | public function getHandlerStat($stat) 121 | { 122 | return isset($this->handlerStats[$stat]) 123 | ? $this->handlerStats[$stat] 124 | : null; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/guzzle/src/functions_include.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/Makefile: -------------------------------------------------------------------------------- 1 | all: clean test 2 | 3 | test: 4 | vendor/bin/phpunit 5 | 6 | coverage: 7 | vendor/bin/phpunit --coverage-html=artifacts/coverage 8 | 9 | view-coverage: 10 | open artifacts/coverage/index.html 11 | 12 | clean: 13 | rm -rf artifacts/* 14 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/promises", 3 | "description": "Guzzle promises library", 4 | "keywords": ["promise"], 5 | "license": "MIT", 6 | "authors": [ 7 | { 8 | "name": "Michael Dowling", 9 | "email": "mtdowling@gmail.com", 10 | "homepage": "https://github.com/mtdowling" 11 | } 12 | ], 13 | "require": { 14 | "php": ">=5.5.0" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "^4.0" 18 | }, 19 | "autoload": { 20 | "psr-4": { 21 | "GuzzleHttp\\Promise\\": "src/" 22 | }, 23 | "files": ["src/functions_include.php"] 24 | }, 25 | "scripts": { 26 | "test": "vendor/bin/phpunit", 27 | "test-ci": "vendor/bin/phpunit --coverage-text" 28 | }, 29 | "extra": { 30 | "branch-alias": { 31 | "dev-master": "1.4-dev" 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/AggregateException.php: -------------------------------------------------------------------------------- 1 | value = $value; 22 | } 23 | 24 | public function then( 25 | callable $onFulfilled = null, 26 | callable $onRejected = null 27 | ) { 28 | // Return itself if there is no onFulfilled function. 29 | if (!$onFulfilled) { 30 | return $this; 31 | } 32 | 33 | $queue = queue(); 34 | $p = new Promise([$queue, 'run']); 35 | $value = $this->value; 36 | $queue->add(static function () use ($p, $value, $onFulfilled) { 37 | if ($p->getState() === self::PENDING) { 38 | try { 39 | $p->resolve($onFulfilled($value)); 40 | } catch (\Throwable $e) { 41 | $p->reject($e); 42 | } catch (\Exception $e) { 43 | $p->reject($e); 44 | } 45 | } 46 | }); 47 | 48 | return $p; 49 | } 50 | 51 | public function otherwise(callable $onRejected) 52 | { 53 | return $this->then(null, $onRejected); 54 | } 55 | 56 | public function wait($unwrap = true, $defaultDelivery = null) 57 | { 58 | return $unwrap ? $this->value : null; 59 | } 60 | 61 | public function getState() 62 | { 63 | return self::FULFILLED; 64 | } 65 | 66 | public function resolve($value) 67 | { 68 | if ($value !== $this->value) { 69 | throw new \LogicException("Cannot resolve a fulfilled promise"); 70 | } 71 | } 72 | 73 | public function reject($reason) 74 | { 75 | throw new \LogicException("Cannot reject a fulfilled promise"); 76 | } 77 | 78 | public function cancel() 79 | { 80 | // pass 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/PromiseInterface.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 22 | } 23 | 24 | public function then( 25 | callable $onFulfilled = null, 26 | callable $onRejected = null 27 | ) { 28 | // If there's no onRejected callback then just return self. 29 | if (!$onRejected) { 30 | return $this; 31 | } 32 | 33 | $queue = queue(); 34 | $reason = $this->reason; 35 | $p = new Promise([$queue, 'run']); 36 | $queue->add(static function () use ($p, $reason, $onRejected) { 37 | if ($p->getState() === self::PENDING) { 38 | try { 39 | // Return a resolved promise if onRejected does not throw. 40 | $p->resolve($onRejected($reason)); 41 | } catch (\Throwable $e) { 42 | // onRejected threw, so return a rejected promise. 43 | $p->reject($e); 44 | } catch (\Exception $e) { 45 | // onRejected threw, so return a rejected promise. 46 | $p->reject($e); 47 | } 48 | } 49 | }); 50 | 51 | return $p; 52 | } 53 | 54 | public function otherwise(callable $onRejected) 55 | { 56 | return $this->then(null, $onRejected); 57 | } 58 | 59 | public function wait($unwrap = true, $defaultDelivery = null) 60 | { 61 | if ($unwrap) { 62 | throw exception_for($this->reason); 63 | } 64 | } 65 | 66 | public function getState() 67 | { 68 | return self::REJECTED; 69 | } 70 | 71 | public function resolve($value) 72 | { 73 | throw new \LogicException("Cannot resolve a rejected promise"); 74 | } 75 | 76 | public function reject($reason) 77 | { 78 | if ($reason !== $this->reason) { 79 | throw new \LogicException("Cannot reject a rejected promise"); 80 | } 81 | } 82 | 83 | public function cancel() 84 | { 85 | // pass 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/RejectionException.php: -------------------------------------------------------------------------------- 1 | reason = $reason; 21 | 22 | $message = 'The promise was rejected'; 23 | 24 | if ($description) { 25 | $message .= ' with reason: ' . $description; 26 | } elseif (is_string($reason) 27 | || (is_object($reason) && method_exists($reason, '__toString')) 28 | ) { 29 | $message .= ' with reason: ' . $this->reason; 30 | } elseif ($reason instanceof \JsonSerializable) { 31 | $message .= ' with reason: ' 32 | . json_encode($this->reason, JSON_PRETTY_PRINT); 33 | } 34 | 35 | parent::__construct($message); 36 | } 37 | 38 | /** 39 | * Returns the rejection reason. 40 | * 41 | * @return mixed 42 | */ 43 | public function getReason() 44 | { 45 | return $this->reason; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/TaskQueue.php: -------------------------------------------------------------------------------- 1 | run(); 12 | */ 13 | class TaskQueue implements TaskQueueInterface 14 | { 15 | private $enableShutdown = true; 16 | private $queue = []; 17 | 18 | public function __construct($withShutdown = true) 19 | { 20 | if ($withShutdown) { 21 | register_shutdown_function(function () { 22 | if ($this->enableShutdown) { 23 | // Only run the tasks if an E_ERROR didn't occur. 24 | $err = error_get_last(); 25 | if (!$err || ($err['type'] ^ E_ERROR)) { 26 | $this->run(); 27 | } 28 | } 29 | }); 30 | } 31 | } 32 | 33 | public function isEmpty() 34 | { 35 | return !$this->queue; 36 | } 37 | 38 | public function add(callable $task) 39 | { 40 | $this->queue[] = $task; 41 | } 42 | 43 | public function run() 44 | { 45 | /** @var callable $task */ 46 | while ($task = array_shift($this->queue)) { 47 | $task(); 48 | } 49 | } 50 | 51 | /** 52 | * The task queue will be run and exhausted by default when the process 53 | * exits IFF the exit is not the result of a PHP E_ERROR error. 54 | * 55 | * You can disable running the automatic shutdown of the queue by calling 56 | * this function. If you disable the task queue shutdown process, then you 57 | * MUST either run the task queue (as a result of running your event loop 58 | * or manually using the run() method) or wait on each outstanding promise. 59 | * 60 | * Note: This shutdown will occur before any destructors are triggered. 61 | */ 62 | public function disableShutdown() 63 | { 64 | $this->enableShutdown = false; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/promises/src/TaskQueueInterface.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "guzzlehttp/psr7", 3 | "type": "library", 4 | "description": "PSR-7 message implementation that also provides common utility methods", 5 | "keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"], 6 | "license": "MIT", 7 | "authors": [ 8 | { 9 | "name": "Michael Dowling", 10 | "email": "mtdowling@gmail.com", 11 | "homepage": "https://github.com/mtdowling" 12 | }, 13 | { 14 | "name": "Tobias Schultze", 15 | "homepage": "https://github.com/Tobion" 16 | } 17 | ], 18 | "require": { 19 | "php": ">=5.4.0", 20 | "psr/http-message": "~1.0", 21 | "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8", 25 | "ext-zlib": "*" 26 | }, 27 | "provide": { 28 | "psr/http-message-implementation": "1.0" 29 | }, 30 | "suggest": { 31 | "zendframework/zend-httphandlerrunner": "Emit PSR-7 responses" 32 | }, 33 | "autoload": { 34 | "psr-4": { 35 | "GuzzleHttp\\Psr7\\": "src/" 36 | }, 37 | "files": ["src/functions_include.php"] 38 | }, 39 | "autoload-dev": { 40 | "psr-4": { 41 | "GuzzleHttp\\Tests\\Psr7\\": "tests/" 42 | } 43 | }, 44 | "extra": { 45 | "branch-alias": { 46 | "dev-master": "1.6-dev" 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/BufferStream.php: -------------------------------------------------------------------------------- 1 | hwm = $hwm; 29 | } 30 | 31 | public function __toString() 32 | { 33 | return $this->getContents(); 34 | } 35 | 36 | public function getContents() 37 | { 38 | $buffer = $this->buffer; 39 | $this->buffer = ''; 40 | 41 | return $buffer; 42 | } 43 | 44 | public function close() 45 | { 46 | $this->buffer = ''; 47 | } 48 | 49 | public function detach() 50 | { 51 | $this->close(); 52 | } 53 | 54 | public function getSize() 55 | { 56 | return strlen($this->buffer); 57 | } 58 | 59 | public function isReadable() 60 | { 61 | return true; 62 | } 63 | 64 | public function isWritable() 65 | { 66 | return true; 67 | } 68 | 69 | public function isSeekable() 70 | { 71 | return false; 72 | } 73 | 74 | public function rewind() 75 | { 76 | $this->seek(0); 77 | } 78 | 79 | public function seek($offset, $whence = SEEK_SET) 80 | { 81 | throw new \RuntimeException('Cannot seek a BufferStream'); 82 | } 83 | 84 | public function eof() 85 | { 86 | return strlen($this->buffer) === 0; 87 | } 88 | 89 | public function tell() 90 | { 91 | throw new \RuntimeException('Cannot determine the position of a BufferStream'); 92 | } 93 | 94 | /** 95 | * Reads data from the buffer. 96 | */ 97 | public function read($length) 98 | { 99 | $currentLength = strlen($this->buffer); 100 | 101 | if ($length >= $currentLength) { 102 | // No need to slice the buffer because we don't have enough data. 103 | $result = $this->buffer; 104 | $this->buffer = ''; 105 | } else { 106 | // Slice up the result to provide a subset of the buffer. 107 | $result = substr($this->buffer, 0, $length); 108 | $this->buffer = substr($this->buffer, $length); 109 | } 110 | 111 | return $result; 112 | } 113 | 114 | /** 115 | * Writes data to the buffer. 116 | */ 117 | public function write($string) 118 | { 119 | $this->buffer .= $string; 120 | 121 | // TODO: What should happen here? 122 | if (strlen($this->buffer) >= $this->hwm) { 123 | return false; 124 | } 125 | 126 | return strlen($string); 127 | } 128 | 129 | public function getMetadata($key = null) 130 | { 131 | if ($key == 'hwm') { 132 | return $this->hwm; 133 | } 134 | 135 | return $key ? null : []; 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/DroppingStream.php: -------------------------------------------------------------------------------- 1 | stream = $stream; 23 | $this->maxLength = $maxLength; 24 | } 25 | 26 | public function write($string) 27 | { 28 | $diff = $this->maxLength - $this->stream->getSize(); 29 | 30 | // Begin returning 0 when the underlying stream is too large. 31 | if ($diff <= 0) { 32 | return 0; 33 | } 34 | 35 | // Write the stream or a subset of the stream if needed. 36 | if (strlen($string) < $diff) { 37 | return $this->stream->write($string); 38 | } 39 | 40 | return $this->stream->write(substr($string, 0, $diff)); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/InflateStream.php: -------------------------------------------------------------------------------- 1 | read(10); 25 | $filenameHeaderLength = $this->getLengthOfPossibleFilenameHeader($stream, $header); 26 | // Skip the header, that is 10 + length of filename + 1 (nil) bytes 27 | $stream = new LimitStream($stream, -1, 10 + $filenameHeaderLength); 28 | $resource = StreamWrapper::getResource($stream); 29 | stream_filter_append($resource, 'zlib.inflate', STREAM_FILTER_READ); 30 | $this->stream = $stream->isSeekable() ? new Stream($resource) : new NoSeekStream(new Stream($resource)); 31 | } 32 | 33 | /** 34 | * @param StreamInterface $stream 35 | * @param $header 36 | * @return int 37 | */ 38 | private function getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header) 39 | { 40 | $filename_header_length = 0; 41 | 42 | if (substr(bin2hex($header), 6, 2) === '08') { 43 | // we have a filename, read until nil 44 | $filename_header_length = 1; 45 | while ($stream->read(1) !== chr(0)) { 46 | $filename_header_length++; 47 | } 48 | } 49 | 50 | return $filename_header_length; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/LazyOpenStream.php: -------------------------------------------------------------------------------- 1 | filename = $filename; 27 | $this->mode = $mode; 28 | } 29 | 30 | /** 31 | * Creates the underlying stream lazily when required. 32 | * 33 | * @return StreamInterface 34 | */ 35 | protected function createStream() 36 | { 37 | return stream_for(try_fopen($this->filename, $this->mode)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/NoSeekStream.php: -------------------------------------------------------------------------------- 1 | @,;:\\\"/[\]?={}\x01-\x20\x7F]++):[ \t]*+((?:[ \t]*+[\x21-\x7E\x80-\xFF]++)*+)[ \t]*+\r?\n)m"; 17 | const HEADER_FOLD_REGEX = "(\r?\n[ \t]++)"; 18 | } 19 | -------------------------------------------------------------------------------- /vendor/guzzlehttp/psr7/src/functions_include.php: -------------------------------------------------------------------------------- 1 | =5.6" 22 | }, 23 | "require-dev": { 24 | "phpunit/phpunit": "~4.8.35 || ~5.7 || ~6.4", 25 | "squizlabs/php_codesniffer": "~1.5" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /vendor/netresearch/jsonmapper/src/JsonMapper/Exception.php: -------------------------------------------------------------------------------- 1 | 10 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 11 | * @link http://cweiske.de/ 12 | */ 13 | 14 | /** 15 | * Simple exception 16 | * 17 | * @category Netresearch 18 | * @package JsonMapper 19 | * @author Christian Weiske 20 | * @license OSL-3.0 http://opensource.org/licenses/osl-3.0 21 | * @link http://cweiske.de/ 22 | */ 23 | class JsonMapper_Exception extends Exception 24 | { 25 | } 26 | ?> 27 | -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/.gitignore: -------------------------------------------------------------------------------- 1 | exampleslocal/ 2 | 3 | # Created by https://www.gitignore.io/api/composer,phpstorm+all 4 | # Edit at https://www.gitignore.io/?templates=composer,phpstorm+all 5 | 6 | ### Composer ### 7 | composer.phar 8 | /vendor/ 9 | 10 | # Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control 11 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 12 | composer.lock 13 | 14 | ### PhpStorm+all ### 15 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 16 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 17 | 18 | # User-specific stuff 19 | .idea/**/workspace.xml 20 | .idea/**/tasks.xml 21 | .idea/**/usage.statistics.xml 22 | .idea/**/dictionaries 23 | .idea/**/shelf 24 | 25 | # Generated files 26 | .idea/**/contentModel.xml 27 | 28 | # Sensitive or high-churn files 29 | .idea/**/dataSources/ 30 | .idea/**/dataSources.ids 31 | .idea/**/dataSources.local.xml 32 | .idea/**/sqlDataSources.xml 33 | .idea/**/dynamic.xml 34 | .idea/**/uiDesigner.xml 35 | .idea/**/dbnavigator.xml 36 | 37 | # Gradle 38 | .idea/**/gradle.xml 39 | .idea/**/libraries 40 | 41 | # Gradle and Maven with auto-import 42 | # When using Gradle or Maven with auto-import, you should exclude module files, 43 | # since they will be recreated, and may cause churn. Uncomment if using 44 | # auto-import. 45 | # .idea/modules.xml 46 | # .idea/*.iml 47 | # .idea/modules 48 | 49 | # CMake 50 | cmake-build-*/ 51 | 52 | # Mongo Explorer plugin 53 | .idea/**/mongoSettings.xml 54 | 55 | # File-based project format 56 | *.iws 57 | 58 | # IntelliJ 59 | out/ 60 | 61 | # mpeltonen/sbt-idea plugin 62 | .idea_modules/ 63 | 64 | # JIRA plugin 65 | atlassian-ide-plugin.xml 66 | 67 | # Cursive Clojure plugin 68 | .idea/replstate.xml 69 | 70 | # Crashlytics plugin (for Android Studio and IntelliJ) 71 | com_crashlytics_export_strings.xml 72 | crashlytics.properties 73 | crashlytics-build.properties 74 | fabric.properties 75 | 76 | # Editor-based Rest Client 77 | .idea/httpRequests 78 | 79 | # Android studio 3.1+ serialized cache file 80 | .idea/caches/build_file_checksums.ser 81 | 82 | # JetBrains templates 83 | **___jb_tmp___ 84 | 85 | ### PhpStorm+all Patch ### 86 | # Ignores the whole .idea folder and all .iml files 87 | # See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360 88 | 89 | .idea/ 90 | 91 | # Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023 92 | 93 | *.iml 94 | modules.xml 95 | .idea/misc.xml 96 | *.ipr 97 | 98 | # Sonarlint plugin 99 | .idea/sonarlint 100 | 101 | # End of https://www.gitignore.io/api/composer,phpstorm+all 102 | -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "picaboooo/snapchatsdk", 3 | "description": "Snapchat private API for PHP", 4 | "type": "library", 5 | "license": "proprietary", 6 | "keywords": [ 7 | "Snapchat", 8 | "Private", 9 | "API", 10 | "PHP" 11 | ], 12 | "support": { 13 | "issues": "https://github.com/Picaboooo/SnapchatSDK/issues", 14 | "wiki": "https://github.com/Picaboooo/SnapchatSDK/wiki", 15 | "source": "https://github.com/Picaboooo/SnapchatSDK/" 16 | }, 17 | "autoload": { 18 | "psr-4": { 19 | "Snapchat\\": "src/Snapchat/", 20 | "Picaboooo\\": "src/Picaboooo/" 21 | } 22 | }, 23 | "require": { 24 | "ext-json": "*", 25 | "ext-openssl": "*", 26 | "ext-zip": "*", 27 | "guzzlehttp/guzzle": "^6.2", 28 | "netresearch/jsonmapper": "v1.4.0" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/assets/snapchat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunilv1605/Snapchat-API/e40dc29282d5f663b09bab2ff410a64e15a3e3fe/vendor/picaboooo/snapchatsdk/examples/assets/snapchat.png -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/download/captcha/deleteme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunilv1605/Snapchat-API/e40dc29282d5f663b09bab2ff410a64e15a3e3fe/vendor/picaboooo/snapchatsdk/examples/download/captcha/deleteme.txt -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/download/snaps/deleteme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunilv1605/Snapchat-API/e40dc29282d5f663b09bab2ff410a64e15a3e3fe/vendor/picaboooo/snapchatsdk/examples/download/snaps/deleteme.txt -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/download/snaptag/deleteme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunilv1605/Snapchat-API/e40dc29282d5f663b09bab2ff410a64e15a3e3fe/vendor/picaboooo/snapchatsdk/examples/download/snaptag/deleteme.txt -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/download/stories/deleteme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sunilv1605/Snapchat-API/e40dc29282d5f663b09bab2ff410a64e15a3e3fe/vendor/picaboooo/snapchatsdk/examples/download/stories/deleteme.txt -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndAddFriend.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Add Friend 14 | $snapchat->addFriend("username_to_add"); 15 | 16 | } catch (Exception $e) { 17 | // Something went wrong... 18 | echo $e->getMessage() . "\n"; 19 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndDownloadMyStories.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Get Stories from Login Response 14 | $storiesResponse = $snapchat->getCachedStoriesResponse(); 15 | 16 | // Iterate My Stories 17 | foreach ($storiesResponse->getMyStories() as $myStory) { 18 | 19 | // he Story object 20 | $story = $myStory->getStory(); 21 | 22 | // Details about who viewed your Story 23 | $storyNotes = $myStory->getStoryNotes(); 24 | 25 | // View and Screenshot counts 26 | $storyExtras = $myStory->getStoryExtras(); 27 | 28 | foreach ($storyNotes as $storyNote) { 29 | // When the Story was viewed 30 | $timestamp = $storyNote->getTimestamp(); 31 | 32 | // Username that viewed the story 33 | $viewer = $storyNote->getViewer(); 34 | 35 | // Did the user screenshot your story? 36 | $screenshot = $storyNote->isScreenshotted(); 37 | 38 | // Do something with the above info 39 | } 40 | 41 | // How many times the story has been screenshot 42 | $screenshotCount = $storyExtras->getScreenshotCount(); 43 | 44 | // How many times the story has been viewed. 45 | $viewCount = $storyExtras->getViewCount(); 46 | 47 | // Where to Save the Story 48 | $filename = sprintf("download/stories/%s.%s", $story->getId(), $story->getFileExtension()); 49 | 50 | // Download the Story 51 | $mediapath = $snapchat->downloadStory($story, $filename); 52 | } 53 | } catch (Exception $e) { 54 | // Something went wrong... 55 | echo $e->getMessage() . "\n"; 56 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndDownloadSnapTag.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Download My SnapTag 14 | $snapchat->downloadMySnapTag(sprintf("download/snaptag/%s.png", $snapchat->getUsername())); 15 | 16 | // Download someone else's SnapTag 17 | $snapchat->downloadSnapTagByUsername("teamsnapchat", "download/snaptag/teamsnapchat.png"); 18 | } catch (Exception $e) { 19 | // Something went wrong... 20 | echo $e->getMessage() . "\n"; 21 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndDownloadStoriesByUsername.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Get Stories from Login Response 14 | $storiesResponse = $snapchat->getCachedStoriesResponse(); 15 | 16 | // Iterate Friend Stories 17 | foreach ($storiesResponse->getFriendStories() as $friendStories) { 18 | 19 | // We only want Stories for this Username 20 | if ($friendStories->getUsername() == "username_you_want_stories_from") { 21 | 22 | $storiesContainer = $friendStories->getStories(); 23 | foreach ($storiesContainer as $storyContainer) { 24 | 25 | $story = $storyContainer->getStory(); 26 | 27 | echo "Downloading Story: " . $story->getId() . "\n"; 28 | 29 | // Where to Save the Files 30 | $filename = sprintf("download/stories/%s.%s", $story->getId(), $story->getFileExtension()); 31 | $filename_overlay = sprintf("download/stories/%s_overlay", $story->getId()); 32 | 33 | // Download the Story 34 | $mediapath = $snapchat->downloadStory($story, $filename, $filename_overlay); 35 | 36 | echo "Story saved to: " . $mediapath->getBlobPath() . "\n"; 37 | if ($mediapath->overlayExists()) { 38 | echo "Story Overlay saved to: " . $mediapath->getOverlayPath() . "\n"; 39 | } 40 | 41 | } 42 | 43 | break; 44 | 45 | } 46 | 47 | } 48 | } catch (Exception $e) { 49 | // Something went wrong... 50 | echo $e->getMessage() . "\n"; 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndDownloadUnviewedSnaps.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Get Conversations from Login Response 14 | $conversations = $snapchat->getCachedConversations(); 15 | 16 | // Download all un-viewed Snaps 17 | foreach ($conversations as $conversation) { 18 | $snaps = $conversation->getSnaps(); 19 | foreach ($snaps as $snap) { 20 | // Only Received Snaps that haven't been Viewed 21 | if ($snap->wasReceived() && !$snap->hasBeenViewed()) { 22 | // Where to Save the Snap 23 | $filename = sprintf("download/snaps/%s.%s", $snap->getId(), $snap->getFileExtension()); 24 | 25 | // Where to Save the Overlay (if it exists) 26 | $filename_overlay = sprintf("download/snaps/%s_overlay.png", $snap->getId()); 27 | 28 | // Download the Snap 29 | $mediapath = $snapchat->downloadSnap($snap, $filename, $filename_overlay); 30 | 31 | echo "Snap saved to: " . $mediapath->getBlobPath() . "\n"; 32 | 33 | if ($mediapath->overlayExists()) { 34 | echo "Snap Overlay saved to: " . $mediapath->getOverlayPath() . "\n"; 35 | } 36 | } 37 | } 38 | } 39 | } catch (Exception $e) { 40 | // Something went wrong... 41 | echo $e->getMessage() . "\n"; 42 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndFindFriendFriends.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Find friends by Numbers and Names 14 | $findFriends = $snapchat->findFriends("NZ", array( 15 | "0000000000" => "Friend Name", 16 | "1234567890" => "Second Friend", 17 | "0987654321" => "Friend Three", 18 | )); 19 | 20 | $results = $findFriends->getResults(); 21 | 22 | foreach ($results as $result) { 23 | echo sprintf("Found Friend: Username=%s Display=%s", $result->getName(), $result->getDisplay()) . "\n"; 24 | } 25 | } catch (Exception $e) { 26 | // Something went wrong... 27 | echo $e->getMessage() . "\n"; 28 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndMarkUnviewedSnapsViewed.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Get Conversations from Login Response 14 | $conversations = $snapchat->getCachedConversations(); 15 | 16 | // Mark all unviewed Snaps as Viewed 17 | foreach ($conversations as $conversation) { 18 | $snaps = $conversation->getSnaps(); 19 | foreach ($snaps as $snap) { 20 | // Snaps we Received and haven't Viewed yet 21 | if ($snap->wasReceived() && !$snap->hasBeenViewed()) { 22 | $snapchat->markSnapViewed($snap); 23 | } 24 | } 25 | } 26 | } catch (Exception $e) { 27 | // Something went wrong... 28 | echo $e->getMessage() . "\n"; 29 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndSendSnap.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 12 | 13 | // Upload Photo to Snapchat 14 | $uploadPayload = $snapchat->uploadPhoto("photo.jpg"); 15 | 16 | // Send Snap 17 | $snapchat->sendMedia($uploadPayload, 10, ["recipient"]); 18 | 19 | // Send Snap (and set as Story) 20 | //$snapchat->sendMedia($uploadPayload, 10, ["recipient"], true); 21 | 22 | // Set Story only 23 | //$snapchat->sendMedia($uploadPayload, 10, [], true); 24 | } catch (Exception $e) { 25 | // Something went wrong... 26 | echo $e->getMessage() . "\n"; 27 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.loginAndViewFriends.php: -------------------------------------------------------------------------------- 1 | login("username", "password"); 13 | 14 | $friendsResponse = $snapchat->getCachedFriendsResponse(); 15 | 16 | // Friends that you added 17 | $friends = $friendsResponse->getFriends(); 18 | 19 | // Friends that added you. 20 | $friendRequests = $friendsResponse->getAddedFriends(); 21 | 22 | foreach ($friends as $friend) { 23 | echo sprintf("You added %s to your friends list!\n", $friend->getName()); 24 | } 25 | 26 | foreach ($friendRequests as $friendRequest) { 27 | $friendType = $friendRequest->getType(); 28 | 29 | // Your Privacy settings are Friends Only 30 | if ($friendType == Friend::TYPE_PENDING) { 31 | echo sprintf("%s wants to add you as a friend!\n", $friendRequest->getName()); 32 | } 33 | 34 | // Your Privacy settings are Everyone 35 | if ($friendType == Friend::TYPE_FOLLOWING) { 36 | echo sprintf("%s is following you, but you haven't added them back\n", $friendRequest->getName()); 37 | } 38 | } 39 | } catch (Exception $e) { 40 | // Something went wrong... 41 | echo $e->getMessage() . "\n"; 42 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/example.other.php: -------------------------------------------------------------------------------- 1 | setProxy("127.0.0.1:8888"); //Proxy for Snapchat API 12 | 13 | // Use AuthToken instead of Username and Password 14 | $snapchat->initWithAuthToken("username", "auth_token"); 15 | 16 | // Download a Snap by ID. You will need to know the File Extension 17 | $mediapath = $snapchat->downloadSnapById("1234567890123456r", "download/snaps/SavedSnap.jpg"); 18 | 19 | // Download a Story by ID. You will need to know the Key/IV and File Extension 20 | $mediapath = $snapchat->downloadStoryById("1234567890123456r", "key", "iv", "download/stories/SavedStory.jpg"); 21 | 22 | // Mark a Snap Viewed by Id (or Snap Object) 23 | $snapchat->markSnapViewed("1234567890123456r"); 24 | 25 | // Mark a Story Viewed by Media Id (or Story Object) 26 | $snapchat->markStoryViewed("xxxxxxxxxxxxxxxx"); 27 | 28 | // Snaps and Chat Messages 29 | $conversations = $snapchat->getConversations(); 30 | 31 | // Friends, Friend Requests 32 | $friendsResponse = $snapchat->getCachedFriendsResponse(); 33 | 34 | // AuthToken, Score, Birthday, etc 35 | $updatesResponse = $snapchat->getAllUpdates(); 36 | 37 | // Your Stories and Friends Stories 38 | $storiesResponse = $snapchat->getStories(); 39 | } catch (Exception $e) { 40 | // Something went wrong... 41 | echo $e->getMessage() . "\n"; 42 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/login_2fa.php: -------------------------------------------------------------------------------- 1 | login($username, $password, $preAuthToken, $odlvPreAuthToken, $otpType); 19 | 20 | // Require 2FA with SMS / App (2FA enabled). 21 | if ($login->isTwoFaNeeded()) { 22 | throw new Exception("2FA needed."); 23 | } 24 | 25 | // Require 2FA with Email / Phone (Suspicious login). 26 | if ($login->isOdlvRequired()) { 27 | 28 | // Select a verification method, should be EMAIL_TOTP or PHONE_TOTP. 29 | $otpType = requestMethod($login); 30 | 31 | // Tell Snapchat to send a token. 32 | $snapchat->requestOneTimePassword($username, $login->getOdlvPreAuthToken(), $otpType); 33 | 34 | // Update variables for 2FA authentication. 35 | $password = requestPassword(); 36 | $odlvPreAuthToken = $login->getOdlvPreAuthToken(); 37 | 38 | continue; 39 | } 40 | 41 | break; 42 | } 43 | 44 | echo 'Successfully signed in.' . PHP_EOL; 45 | 46 | // The $snapchat instance is now fully authenticated. 47 | 48 | // Make sure to cache 49 | // - $snapchat->getDeviceTokenIdentifier() 50 | // - $snapchat->getDeviceTokenVerifier() 51 | // And set it back with 52 | // - $snapchat->initDeviceToken($deviceTokenIdentifier, $deviceTokenVerifier) 53 | // In a real application so you do not have to re-do 2FA. 54 | } catch (Exception $e) { 55 | // Something went wrong... 56 | echo $e->getMessage() . "\n"; 57 | } 58 | 59 | /** 60 | * @param LoginResponse $response 61 | * @return string 62 | */ 63 | function requestMethod($response) { 64 | echo 'You have to do 2FA for this account.' . PHP_EOL; 65 | echo 'Please choose an option below:' . PHP_EOL; 66 | 67 | if (!empty($response->getObfuscatedEmail())) { 68 | echo ' [1] Email ' . $response->getObfuscatedEmail() . PHP_EOL; 69 | } 70 | 71 | if (!empty($response->getObfuscatedPhone())) { 72 | echo ' [2] Phone ' . $response->getObfuscatedPhone() . PHP_EOL; 73 | } 74 | 75 | $valid = false; 76 | 77 | do { 78 | echo "Enter a valid number: "; 79 | 80 | $index = intval(trim(fgets(STDIN))); 81 | if ($index == 1 || $index == 2) break; 82 | } while(!$valid); 83 | 84 | if ($index == 1) { 85 | return 'EMAIL_TOTP'; 86 | } else { 87 | return 'PHONE_TOTP'; 88 | } 89 | } 90 | 91 | function requestPassword() { 92 | echo 'Enter the 2FA token: ' . PHP_EOL; 93 | return trim(fgets(STDIN)); 94 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/examples/register.php: -------------------------------------------------------------------------------- 1 | register($username, $password, $firstName, $lastName, $birthday, "America/New_York"); 33 | 34 | echo "Account Registered.!\n"; 35 | 36 | if ($response->getVerificationNeeded() != null) { 37 | if ($response->getVerificationNeeded()->getType() == VerificationNeeded::TYPE_CAPTCHA) { 38 | echo "Captcha message: " . $response->getVerificationNeeded()->getPrompt(); 39 | goto solve_captcha; 40 | } else { 41 | echo "Unknown verification was requested: " . $response->getVerificationNeeded()->getType(); 42 | } 43 | } else { 44 | goto done; 45 | } 46 | } catch (Exception $e) { 47 | echo $e->getMessage() . "\n"; 48 | goto register_account; 49 | } 50 | } 51 | 52 | solve_captcha: { 53 | echo "Downloading Captcha...\n"; 54 | 55 | $captcha = $snapchat->getCaptcha("download/captcha"); 56 | 57 | echo "The Captcha solution is a string of 1's and 0's.\n"; 58 | echo sprintf("View the Images in the folder: %s\n", $captcha->getFolder()); 59 | echo "If the Image has a ghost (or number), enter a 1 else enter a 0.\n"; 60 | echo "Folder will be deleted afterwards.\n"; 61 | 62 | echo "Solution: "; 63 | $solution = trim(fgets(STDIN)); 64 | 65 | try { 66 | $snapchat->solveCaptcha($captcha->getId(), $solution); 67 | } finally { 68 | FileUtil::deleteDirectory($captcha->getFolder()); 69 | } 70 | 71 | goto done; 72 | } 73 | 74 | done: { 75 | echo "Account Verified, all done!\n"; 76 | } 77 | } catch (Exception $e) { 78 | // Something went wrong... 79 | echo $e->getMessage() . "\n"; 80 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Picaboooo/PicabooooException.php: -------------------------------------------------------------------------------- 1 | path = $path; 25 | $this->mime = $mime; 26 | $this->name = $name; 27 | } 28 | 29 | /** 30 | * @return string File Path 31 | */ 32 | public function getPath() 33 | { 34 | return $this->path; 35 | } 36 | 37 | /** 38 | * @return string Mime Type 39 | */ 40 | public function getMime() 41 | { 42 | return $this->mime; 43 | } 44 | 45 | /** 46 | * @return string Name 47 | */ 48 | public function getName() 49 | { 50 | return $this->name; 51 | } 52 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Framework/Response.php: -------------------------------------------------------------------------------- 1 | response = $response; 34 | $this->data = $data; 35 | } 36 | 37 | /** 38 | * 39 | * Get Response Code 40 | * 41 | * @return int Response Code 42 | */ 43 | public function getCode() 44 | { 45 | return $this->response->getStatusCode(); 46 | } 47 | 48 | /** 49 | * 50 | * Get Response Data 51 | * 52 | * @return object Response Data 53 | */ 54 | public function getData() 55 | { 56 | return $this->data; 57 | } 58 | 59 | public function getContentDispositionFilename() 60 | { 61 | $headerLine = $this->response->getHeaderLine('Content-Disposition'); 62 | parse_str($headerLine, $results); 63 | return $results["attachment;filename"]; 64 | } 65 | 66 | /** 67 | * 68 | * Check if the Response was 200 OK 69 | * 70 | * @return bool 71 | */ 72 | public function isOK() 73 | { 74 | return in_array($this->getCode(), array(self::OK, self::CREATED, self::ACCEPTED)); 75 | } 76 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/AllUpdatesRequest.php: -------------------------------------------------------------------------------- 1 | mediaKey = $mediaKey; 25 | $this->mediaIv = $mediaIv; 26 | 27 | $this->addParam("story_id", $mediaId); 28 | 29 | } 30 | 31 | public function getMethod() 32 | { 33 | return self::POST; 34 | } 35 | 36 | public function getEndpoint() 37 | { 38 | return "/bq/auth_story_blob"; 39 | } 40 | 41 | public function getResponseObject() 42 | { 43 | return null; 44 | } 45 | 46 | public function parseResponse() 47 | { 48 | return false; 49 | } 50 | 51 | /** 52 | * @return object 53 | * @throws \Exception 54 | */ 55 | public function execute() 56 | { 57 | return StoryCrypto::decryptStory(parent::execute(), $this->mediaKey, $this->mediaIv); 58 | } 59 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/AuthenticatedBaseRequest.php: -------------------------------------------------------------------------------- 1 | snapchat->getUsername(); 10 | } 11 | 12 | public function getAuthToken() 13 | { 14 | return $this->snapchat->getAuthToken(); 15 | } 16 | 17 | public function picabooAuthCallback($endpointEndpointAuth) 18 | { 19 | $this->addParam("username", $this->snapchat->getUsername()); 20 | } 21 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/BlobRequest.php: -------------------------------------------------------------------------------- 1 | addParam("id", $id); 17 | } 18 | 19 | public function getMethod() 20 | { 21 | return self::POST; 22 | } 23 | 24 | public function getEndpoint() 25 | { 26 | return "/bq/blob"; 27 | } 28 | 29 | public function getResponseObject() 30 | { 31 | return null; 32 | } 33 | 34 | public function parseResponse() 35 | { 36 | return false; 37 | } 38 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/ClearConversationRequest.php: -------------------------------------------------------------------------------- 1 | addParam("conversation_id", $conversationId); 17 | 18 | } 19 | 20 | public function getMethod(){ 21 | return self::POST; 22 | } 23 | 24 | public function getEndpoint(){ 25 | return "/loq/clear_conversation"; 26 | } 27 | 28 | public function getResponseObject(){ 29 | return null; 30 | } 31 | 32 | public function parseResponse(){ 33 | return false; 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/ClearFeedRequest.php: -------------------------------------------------------------------------------- 1 | addParam("conversation_id", $conversationId); 18 | 19 | } 20 | 21 | public function getMethod(){ 22 | return self::POST; 23 | } 24 | 25 | public function getEndpoint(){ 26 | return "/loq/conversation_auth_token"; 27 | } 28 | 29 | public function getResponseObject(){ 30 | return new ConversationAuthTokenResponse(); 31 | } 32 | 33 | /** 34 | * @return ConversationAuthTokenResponse 35 | * @throws \Exception 36 | */ 37 | public function execute(){ 38 | return parent::execute(); 39 | } 40 | 41 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/ConversationPostMessagesRequest.php: -------------------------------------------------------------------------------- 1 | addParam("messages", json_encode($messages)); 20 | 21 | } 22 | 23 | public function getMethod(){ 24 | return self::POST; 25 | } 26 | 27 | public function getEndpoint(){ 28 | return "/loq/conversation_post_messages"; 29 | } 30 | 31 | public function getResponseObject(){ 32 | return null; 33 | } 34 | 35 | public function parseResponse(){ 36 | return false; 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/ConversationRequest.php: -------------------------------------------------------------------------------- 1 | addParam("features_map", "{}"); 19 | $this->addParam("conversation_id", RequestUtil::getConversationID($this->snapchat->getUsername(), $username)); 20 | 21 | } 22 | 23 | public function getMethod(){ 24 | return self::POST; 25 | } 26 | 27 | public function getEndpoint(){ 28 | return "/loq/conversation"; 29 | } 30 | 31 | public function getResponseObject(){ 32 | return new ConversationResponse(); 33 | } 34 | 35 | /** 36 | * @return ConversationResponse 37 | * @throws \Exception 38 | */ 39 | public function execute(){ 40 | return parent::execute(); 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/ConversationsRequest.php: -------------------------------------------------------------------------------- 1 | addParam("checksums_dict", ""); 19 | $this->addParam("features_map", "{}"); 20 | 21 | if(!empty($offset)) { 22 | $this->addParam("offset", $offset); 23 | } 24 | 25 | } 26 | 27 | public function getMethod(){ 28 | return self::POST; 29 | } 30 | 31 | public function getEndpoint(){ 32 | return "/loq/conversations"; 33 | } 34 | 35 | public function getResponseObject(){ 36 | return new ConversationsResponse(); 37 | } 38 | 39 | /** 40 | * @return ConversationsResponse 41 | * @throws \Exception 42 | */ 43 | public function execute(){ 44 | return parent::execute(); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/DeleteStoryRequest.php: -------------------------------------------------------------------------------- 1 | addParam("story_id", $storyId); 17 | 18 | } 19 | 20 | public function getMethod(){ 21 | return self::POST; 22 | } 23 | 24 | public function getEndpoint(){ 25 | return "/bq/delete_story"; 26 | } 27 | 28 | public function getResponseObject(){ 29 | return null; 30 | } 31 | 32 | public function parseResponse(){ 33 | return false; 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/DeviceTokenRequest.php: -------------------------------------------------------------------------------- 1 | "name"); Maximum of 30 per Request. 14 | */ 15 | public function __construct($snapchat, $country, $query){ 16 | 17 | parent::__construct($snapchat); 18 | $this->addParam("countryCode", strtoupper($country)); 19 | $this->addParam("numbers", json_encode($query, JSON_FORCE_OBJECT)); 20 | $this->addParam("should_recommend", "false"); 21 | 22 | } 23 | 24 | public function getMethod(){ 25 | return self::POST; 26 | } 27 | 28 | public function getEndpoint(){ 29 | return "/bq/find_friends"; 30 | } 31 | 32 | public function getResponseObject(){ 33 | return new FindFriendsResponse(); 34 | } 35 | 36 | public function interceptResponse($response){ 37 | 38 | if($response->getCode() == 304){ 39 | throw new \Exception("You have been temporarily blocked from using Find Friends by Snapchat."); 40 | } 41 | 42 | return parent::interceptResponse($response); 43 | 44 | } 45 | 46 | /** 47 | * @return FindFriendsResponse 48 | * @throws \Exception 49 | */ 50 | public function execute(){ 51 | return parent::execute(); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/FriendRequest.php: -------------------------------------------------------------------------------- 1 | addParam("friend", $username); 30 | $friend = $this->snapchat->findCachedFriend($username); 31 | 32 | if ($friend != null) { 33 | $this->addParam(self::KEY_FRIEND_ID, $friend->getUserId()); 34 | $this->addParam(self::KEY_IDENTITY_CELL_INDEX, "-1"); 35 | $this->addParam(self::KEY_IDENTITY_PROFILE_PAGE, self::KEY_IDENTITY_PROFILE_MY_FRIENDS_PAGE); 36 | } else { 37 | $this->addParam(self::KEY_IDENTITY_CELL_INDEX, "0"); 38 | $this->addParam(self::KEY_IDENTITY_PROFILE_PAGE, self::KEY_IDENTITY_PROFILE_ADD_FRIENDS_BY_USERNAME_PAGE); 39 | } 40 | } 41 | 42 | public function updateDisplayName($display) 43 | { 44 | $this->addParam(self::KEY_ACTION, "display"); 45 | $this->addParam("display", $display); 46 | } 47 | 48 | public function block() 49 | { 50 | $this->addParam(self::KEY_ACTION, "block"); 51 | } 52 | 53 | public function unblock() 54 | { 55 | $this->addParam(self::KEY_ACTION, "unblock"); 56 | } 57 | 58 | public function add() 59 | { 60 | $this->addParam(self::KEY_ACTION, "add"); 61 | $this->addParam(self::KEY_ADDED_BY, Friend::ADDED_BY_USERNAME); 62 | } 63 | 64 | public function delete() 65 | { 66 | $this->addParam(self::KEY_ACTION, "delete"); 67 | $this->addParam(self::KEY_ADDED_BY, Friend::ADDED_BY_USERNAME); 68 | } 69 | 70 | public function getMethod() 71 | { 72 | return self::POST; 73 | } 74 | 75 | public function getEndpoint() 76 | { 77 | return "/bq/friend"; 78 | } 79 | 80 | public function getResponseObject() 81 | { 82 | return new FriendResponse(); 83 | } 84 | 85 | /** 86 | * @return FriendResponse 87 | * @throws Exception 88 | */ 89 | public function execute() 90 | { 91 | return parent::execute(); 92 | } 93 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/GetCaptchaRequest.php: -------------------------------------------------------------------------------- 1 | getClient()); 43 | 44 | $this->snapchat = $snapchat; 45 | 46 | $this->setProxy($this->snapchat->getProxy()); 47 | $this->setVerifyPeer($this->snapchat->shouldVerifyPeer()); 48 | 49 | $this->username = $username; 50 | $this->password = $password; 51 | 52 | $this->preAuthToken = $preAuthToken; 53 | $this->odlvPreAuthToken = $odlvPreAuthToken; 54 | $this->otpType = $otpType; 55 | } 56 | 57 | public function getMethod() 58 | { 59 | return self::POST; 60 | } 61 | 62 | public function getUrl() 63 | { 64 | return $this->url; 65 | } 66 | 67 | /** 68 | * 69 | * Execute the Request 70 | * 71 | * @throws PicabooooException 72 | * @throws JsonMapper_Exception 73 | * @throws Exception 74 | * @return LoginResponse 75 | */ 76 | public function execute() 77 | { 78 | $this->clearHeaders(); 79 | $this->clearParams(); 80 | 81 | $deviceToken = $this->snapchat->getCachedDeviceToken(); 82 | $requestData = $this->snapchat->getPicaboo()->getAuthenticatedLogin( 83 | $this->username, 84 | $this->password, 85 | $deviceToken->getDeviceTokenIdentifier(), 86 | $deviceToken->getDeviceTokenVerifier(), 87 | $this->preAuthToken, 88 | $this->odlvPreAuthToken, 89 | $this->otpType); 90 | 91 | $this->url = $requestData["url"]; 92 | 93 | foreach ($requestData["headers"] as $key => $value) { 94 | $this->addHeader($key, $value); 95 | } 96 | 97 | foreach ($requestData["params"] as $key => $value) { 98 | $this->addParam($key, $value); 99 | } 100 | 101 | $response = parent::execute(); 102 | 103 | if (!$response->isOK()) { 104 | throw new SnapchatException(sprintf("[%s] Login Failed!", $response->getCode())); 105 | } 106 | 107 | return $this->mapper->map(\GuzzleHttp\json_decode($response->getData()), new LoginResponse()); 108 | } 109 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/LogoutRequest.php: -------------------------------------------------------------------------------- 1 | addParam("events", "[]"); 16 | 17 | } 18 | 19 | public function getMethod(){ 20 | return self::POST; 21 | } 22 | 23 | public function getEndpoint(){ 24 | return "/ph/logout"; 25 | } 26 | 27 | public function getResponseObject(){ 28 | return null; 29 | } 30 | 31 | public function parseResponse(){ 32 | return false; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/Model/SendMediaPayload.php: -------------------------------------------------------------------------------- 1 | addParam("odlv_pre_auth_token", $odlvPreAuthToken); 19 | $this->addParam("otp_type", $otpType); 20 | $this->addParam("username", $username); 21 | } 22 | 23 | public function getMethod() 24 | { 25 | return self::POST; 26 | } 27 | 28 | public function getEndpoint() 29 | { 30 | return "/account/odlv/request_otp"; 31 | } 32 | 33 | public function getResponseObject() 34 | { 35 | return null; 36 | } 37 | 38 | public function parseResponse() 39 | { 40 | return false; 41 | } 42 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/PhoneVerifyRequest.php: -------------------------------------------------------------------------------- 1 | addParam("action", "updatePhoneNumber"); 12 | $this->addParam("countryCode", strtoupper($country)); 13 | $this->addParam("method", "text"); 14 | $this->addParam("password", $this->snapchat->getUsername()); 15 | $this->addParam("phoneNumber", $number); 16 | 17 | } 18 | 19 | public function updatePhoneNumberWithCall($country, $number){ 20 | 21 | $this->addParam("action", "updatePhoneNumberWithCall"); 22 | $this->addParam("countryCode", strtoupper($country)); 23 | $this->addParam("method", "call"); 24 | $this->addParam("password", $this->snapchat->getUsername()); 25 | $this->addParam("phoneNumber", $number); 26 | 27 | } 28 | 29 | public function verifyPhoneNumber($code){ 30 | 31 | $this->addParam("action", "verifyPhoneNumber"); 32 | $this->addParam("code", $code); 33 | $this->addParam("password", $this->snapchat->getUsername()); 34 | $this->addParam("skipConfirmation", true); 35 | $this->addParam("type", "DEFAULT_TYPE"); 36 | 37 | } 38 | 39 | public function getMethod(){ 40 | return self::POST; 41 | } 42 | 43 | public function getEndpoint(){ 44 | return "/bq/phone_verify"; 45 | } 46 | 47 | public function getResponseObject(){ 48 | return new PhoneVerifyResponse(); 49 | } 50 | 51 | public function picabooAuthCallback($endpointAuth){ 52 | parent::picabooAuthCallback($endpointAuth); 53 | 54 | $params = $endpointAuth["params"]; 55 | 56 | $deviceToken = $this->snapchat->getCachedDeviceToken(); 57 | $deviceToken->initDeviceSignatureRegistration($this->snapchat->getUsername(), $this->snapchat->getUsername(), $params["timestamp"], $params["req_token"]); 58 | 59 | $this->addParam("dsig", $deviceToken->getDeviceSignature()); 60 | $this->addParam("dtoken1i", $deviceToken->getDeviceTokenIdentifier()); 61 | } 62 | 63 | /** 64 | * @return PhoneVerifyResponse 65 | * @throws \Exception 66 | */ 67 | public function execute(){ 68 | return parent::execute(); 69 | } 70 | 71 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/RegisterRequest.php: -------------------------------------------------------------------------------- 1 | snapchat = $snapchat; 30 | 31 | $this->username = $username; 32 | $this->password = $password; 33 | 34 | $this->addParam("birthday", $birthday); 35 | $this->addParam("device_check_token", "DEVICE_CHECK_NOT_SUPPORTED_GTE_IOS11"); 36 | $this->addParam("fidelius_client_init", ""); 37 | $this->addParam("first_name", $firstName); 38 | $this->addParam("from_deeplink", "false"); 39 | $this->addParam("last_name", $lastName); 40 | $this->addParam("username", $username); 41 | $this->addParam("password", $password); 42 | $this->addParam("study_settings", "{\"CONSOLE_V2_BETA_PP_111\":{\"VARIABLE_5\":\"True\",\"experimentId\":\"78\",\"VARIABLE_1\":\"False\",\"groupId\":\"1\",\"VARIABLE_4\":\"falae\",\"VARIABLE_2\":\"True\"},\"CONSOLE_V2_BETA_PP_109\":{\"VARIABLE_5\":\"True\",\"experimentId\":\"84\",\"VARIABLE_1\":\"False\",\"VARIABLE_6\":\"True\",\"groupId\":\"2\"},\"CONSOLE_V2_BETA_PP_119\":{\"VARIABLE_5\":\"True\",\"experimentId\":\"57\",\"sdfsf\":\"True\",\"groupId\":\"3\",\"VARIABLE_4\":\"True\",\"VARIABLE_2\":\"True\"},\"CONSOLE_V2_BETA_PP_72\":{\"groupId\":\"0\",\"experimentId\":\"4\",\"VARIABLE_1\":\"False\",\"VARIABLE_3\":\"True\",\"VARIABLE_2\":\"True\"},\"CONSOLE_V2_BETA_PP_55\":{\"groupId\":\"3\",\"experimentId\":\"37\",\"VARIABLE_1\":\"True\",\"VARIABLE_2\":\"True\"}}"); 43 | $this->addParam("time_zone", $timezone); 44 | } 45 | 46 | public function getMethod() 47 | { 48 | return self::POST; 49 | } 50 | 51 | public function getEndpoint() 52 | { 53 | return "/loq/register_v2"; 54 | } 55 | 56 | public function getResponseObject() 57 | { 58 | return new LoginResponse(); 59 | } 60 | 61 | /** 62 | * @param object $endpointAuth 63 | * @throws Exception 64 | */ 65 | public function picabooAuthCallback($endpointAuth) 66 | { 67 | $params = $endpointAuth["params"]; 68 | 69 | $deviceToken = $this->snapchat->getCachedDeviceToken(); 70 | $deviceToken->initDeviceSignatureRegistration($this->username, $this->password, $params["timestamp"], $params["req_token"]); 71 | 72 | $this->addParam("dsig", $deviceToken->getDeviceSignature()); 73 | $this->addParam("dtoken1i", $deviceToken->getDeviceTokenIdentifier()); 74 | } 75 | 76 | /** 77 | * @return LoginResponse 78 | * @throws Exception 79 | */ 80 | public function execute() 81 | { 82 | return parent::execute(); 83 | } 84 | 85 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/RegisterUsernameRequest.php: -------------------------------------------------------------------------------- 1 | addParam("selected_username", $username); 20 | $this->addParam("email", $this->snapchat->getUsername()); 21 | 22 | $this->addParam("width", Constants::SCREEN_WIDTH_PX); 23 | $this->addParam("height", Constants::SCREEN_HEIGHT_PX); 24 | 25 | } 26 | 27 | public function getMethod(){ 28 | return self::POST; 29 | } 30 | 31 | public function getEndpoint(){ 32 | return "/loq/register_username"; 33 | } 34 | 35 | public function getResponseObject(){ 36 | return new RegisterUsernameResponse(); 37 | } 38 | 39 | /** 40 | * @return RegisterUsernameResponse 41 | * @throws \Exception 42 | */ 43 | public function execute(){ 44 | return parent::execute(); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/SendMediaRequest.php: -------------------------------------------------------------------------------- 1 | payload = $payload; 31 | 32 | $this->addParam("time", $payload->time); 33 | $this->addParam("media_id", $payload->media_id); 34 | $this->addParam("zipped", $payload->zipped); 35 | $this->addParam("camera_front_facing", "0"); 36 | $this->addParam("orientation", self::ORIENTATION_PORTRAIT); 37 | $this->addParam("features_map", "{}"); 38 | 39 | if (!empty($payload->recipients)) { 40 | $this->addParam("recipients", json_encode($payload->recipients)); 41 | } 42 | 43 | if (!empty($payload->recipient_ids)) { 44 | $this->addParam("recipient_ids", json_encode($payload->recipient_ids)); 45 | } 46 | 47 | if ($payload->set_as_story) { 48 | $this->addParam("shared_ids", "{}"); 49 | $this->addParam("caption_text_display", ""); 50 | $this->addParam("client_id", $payload->media_id); 51 | 52 | $this->addParam("my_story", "true"); 53 | $this->addParam("type", $payload->type); 54 | $this->addParam("story_timestamp", RequestUtil::getCurrentMillis() / 1000); 55 | 56 | //todo: Support Video Thumbnails 57 | //$this->addFile("thumbnail_data", new RequestFile($this->payload->file_thumbnail, "application/octet-stream", "thumbnail_data")); 58 | } 59 | } 60 | 61 | public function getMethod() 62 | { 63 | return self::POST; 64 | } 65 | 66 | public function getEndpoint() 67 | { 68 | if ($this->payload->set_as_story) { 69 | if (empty($this->payload->recipients)) { 70 | return self::ENDPOINT_POST_STORY; 71 | } else { 72 | return self::ENDPOINT_DOUBLE_POST; 73 | } 74 | } 75 | 76 | return self::ENDPOINT_SEND; 77 | } 78 | 79 | public function getResponseObject() 80 | { 81 | return null; 82 | } 83 | 84 | public function parseResponse() 85 | { 86 | return false; 87 | } 88 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/SnapTagRequest.php: -------------------------------------------------------------------------------- 1 | addParam("image", $qrPath); 23 | $this->shouldParseResponse = false; 24 | } 25 | 26 | /** 27 | * @param $username string Username to get SnapTag for 28 | * @param string $type string Image Type. 29 | */ 30 | public function getSnapTagByUsername($username, $type = self::TYPE_PNG){ 31 | 32 | $this->addParam("type", $type); 33 | $this->addParam("username_snapcode", $username); 34 | 35 | $friend = $this->snapchat->findCachedFriend($username); 36 | if($friend != null){ 37 | $this->addParam("user_id", $friend->getUserId()); 38 | } 39 | 40 | $this->shouldParseResponse = true; 41 | 42 | } 43 | 44 | public function getMethod(){ 45 | return self::POST; 46 | } 47 | 48 | public function getEndpoint(){ 49 | return "/bq/snaptag_download"; 50 | } 51 | 52 | public function getResponseObject(){ 53 | return new SnapTagResponse(); 54 | } 55 | 56 | public function parseResponse(){ 57 | return $this->shouldParseResponse; 58 | } 59 | 60 | /** 61 | * @return object|SnapTagResponse 62 | * @throws \Exception 63 | */ 64 | public function execute(){ 65 | return parent::execute(); 66 | } 67 | 68 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/SolveCaptchaRequest.php: -------------------------------------------------------------------------------- 1 | addParam("captcha_id", $id); 21 | $this->addParam("captcha_solution", $solution); 22 | } 23 | 24 | public function getMethod() 25 | { 26 | return self::POST; 27 | } 28 | 29 | public function getEndpoint() 30 | { 31 | return "/bq/solve_captcha"; 32 | } 33 | 34 | public function getResponseObject() 35 | { 36 | return new SolveCaptchaResponse(); 37 | } 38 | 39 | /** 40 | * @return SolveCaptchaResponse 41 | * @throws Exception 42 | */ 43 | public function execute() 44 | { 45 | return parent::execute(); 46 | } 47 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/StoriesRequest.php: -------------------------------------------------------------------------------- 1 | addParam("checksum", ""); 19 | $this->addParam("features_map", "{}"); 20 | $this->addParam("screen_width_in", Constants::SCREEN_WIDTH_IN); 21 | $this->addParam("screen_height_in", Constants::SCREEN_HEIGHT_IN); 22 | $this->addParam("screen_width_px", Constants::SCREEN_WIDTH_PX); 23 | $this->addParam("screen_height_px", Constants::SCREEN_HEIGHT_PX); 24 | 25 | } 26 | 27 | public function getMethod(){ 28 | return self::POST; 29 | } 30 | 31 | public function getEndpoint(){ 32 | return "/bq/stories"; 33 | } 34 | 35 | public function getResponseObject(){ 36 | return new StoriesResponse(); 37 | } 38 | 39 | /** 40 | * @return StoriesResponse 41 | * @throws \Exception 42 | */ 43 | public function execute(){ 44 | return parent::execute(); 45 | } 46 | 47 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/UpdateSnapsRequest.php: -------------------------------------------------------------------------------- 1 | snapId = $snapId; 25 | $this->secondsViewedFor = $secondsViewedFor; 26 | 27 | $cachedUpdates = $snapchat->getCachedUpdatesResponse(); 28 | $this->addParam("added_friends_timestamp", $cachedUpdates->getAddedFriendsTimestamp()); 29 | 30 | } 31 | 32 | /** 33 | * Set whether this Snap is being marked as Replayed 34 | * @param $replayed boolean 35 | */ 36 | public function setReplayed($replayed){ 37 | $this->replayed = $replayed; 38 | } 39 | 40 | /** 41 | * Set whether this Snap is being marked as Screenshot 42 | * @param $screenshot boolean 43 | */ 44 | public function setScreenshot($screenshot){ 45 | $this->screenshot = $screenshot; 46 | } 47 | 48 | public function getMethod(){ 49 | return self::POST; 50 | } 51 | 52 | public function getEndpoint(){ 53 | return "/bq/update_snaps"; 54 | } 55 | 56 | public function getResponseObject(){ 57 | return null; 58 | } 59 | 60 | public function parseResponse(){ 61 | return false; 62 | } 63 | 64 | /** 65 | * @return object 66 | * @throws \Exception 67 | */ 68 | public function execute(){ 69 | 70 | $viewed_time = $this->secondsViewedFor * 1000; 71 | 72 | $json = json_encode(array( 73 | $this->snapId => array( 74 | "c" => $this->screenshot ? "1" : "0", 75 | "replayed" => $this->replayed ? "1" : "0", 76 | "sv" => $viewed_time, 77 | "t" => time(), 78 | ) 79 | )); 80 | 81 | $this->addParam("json", $json); 82 | 83 | return parent::execute(); 84 | 85 | } 86 | 87 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/UpdateStoriesRequest.php: -------------------------------------------------------------------------------- 1 | storyId = $storyId; 22 | 23 | } 24 | 25 | /** 26 | * Set whether this Story is being marked as Screenshot 27 | * @param $screenshot boolean 28 | */ 29 | public function setScreenshot($screenshot){ 30 | $this->screenshot = $screenshot; 31 | } 32 | 33 | public function getMethod(){ 34 | return self::POST; 35 | } 36 | 37 | public function getEndpoint(){ 38 | return "/bq/update_stories"; 39 | } 40 | 41 | public function getResponseObject(){ 42 | return null; 43 | } 44 | 45 | public function parseResponse(){ 46 | return false; 47 | } 48 | 49 | /** 50 | * @return object 51 | * @throws \Exception 52 | */ 53 | public function execute(){ 54 | 55 | $friend_stories = array(); 56 | 57 | $friend_stories[] = array( 58 | "id" => $this->storyId, 59 | "screenshot_count" => $this->screenshot ? "1" : "0", 60 | "timestamp" => RequestUtil::getCurrentMillis() 61 | ); 62 | 63 | $this->addParam("friend_stories", json_encode($friend_stories)); 64 | 65 | return parent::execute(); 66 | 67 | } 68 | 69 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Request/UploadMediaRequest.php: -------------------------------------------------------------------------------- 1 | payload = $payload; 25 | 26 | $this->addParam("features_map", "{}"); 27 | $this->addParam("type", $this->payload->type); 28 | $this->addParam("media_id", $this->payload->media_id); 29 | 30 | $this->addFile("data", new RequestFile($this->payload->file, "application/octet-stream", "data")); 31 | } 32 | 33 | public function getMethod() 34 | { 35 | return self::POST; 36 | } 37 | 38 | public function getEndpoint() 39 | { 40 | return "/bq/upload"; 41 | } 42 | 43 | public function getResponseObject() 44 | { 45 | return null; 46 | } 47 | 48 | public function parseResponse() 49 | { 50 | return false; 51 | } 52 | 53 | /** 54 | * @return UploadMediaPayload 55 | * @throws \Exception 56 | */ 57 | public function execute() 58 | { 59 | parent::execute(); 60 | return $this->payload; 61 | } 62 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/AllUpdatesResponse.php: -------------------------------------------------------------------------------- 1 | logged; 24 | } 25 | 26 | /** 27 | * @param bool $logged 28 | */ 29 | public function setLogged($logged) 30 | { 31 | $this->logged = $logged; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getMessage() 38 | { 39 | return $this->message; 40 | } 41 | 42 | /** 43 | * @param string $message 44 | */ 45 | public function setMessage($message) 46 | { 47 | $this->message = $message; 48 | } 49 | 50 | /** 51 | * @return int 52 | */ 53 | public function getStatus() 54 | { 55 | return $this->status; 56 | } 57 | 58 | /** 59 | * @param int $status 60 | */ 61 | public function setStatus($status) 62 | { 63 | $this->status = $status; 64 | } 65 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/ConversationAuthTokenResponse.php: -------------------------------------------------------------------------------- 1 | messaging_auth; 21 | } 22 | 23 | /** 24 | * @param MessagingAuth $messaging_auth 25 | */ 26 | public function setMessagingAuth($messaging_auth) 27 | { 28 | $this->messaging_auth = $messaging_auth; 29 | } 30 | 31 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/ConversationResponse.php: -------------------------------------------------------------------------------- 1 | conversation; 19 | } 20 | 21 | /** 22 | * @param Model\Conversation $conversation 23 | */ 24 | public function setConversation($conversation) 25 | { 26 | $this->conversation = $conversation; 27 | } 28 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/ConversationsResponse.php: -------------------------------------------------------------------------------- 1 | updates_response; 37 | } 38 | 39 | /** 40 | * @param UpdatesResponse $updates_response 41 | */ 42 | public function setUpdatesResponse($updates_response) 43 | { 44 | $this->updates_response = $updates_response; 45 | } 46 | 47 | /** 48 | * @return FriendsResponse 49 | */ 50 | public function getFriendsResponse() 51 | { 52 | return $this->friends_response; 53 | } 54 | 55 | /** 56 | * @param FriendsResponse $friends_response 57 | */ 58 | public function setFriendsResponse($friends_response) 59 | { 60 | $this->friends_response = $friends_response; 61 | } 62 | 63 | /** 64 | * @return Model\Conversation[] 65 | */ 66 | public function getConversationsResponse() 67 | { 68 | return $this->conversations_response; 69 | } 70 | 71 | /** 72 | * @param Model\Conversation[] $conversations_response 73 | */ 74 | public function setConversationsResponse($conversations_response) 75 | { 76 | $this->conversations_response = $conversations_response; 77 | } 78 | 79 | /** 80 | * @return Model\MessagingGatewayInfo 81 | */ 82 | public function getMessagingGatewayInfo() 83 | { 84 | return $this->messaging_gateway_info; 85 | } 86 | 87 | /** 88 | * @param Model\MessagingGatewayInfo $messaging_gateway_info 89 | */ 90 | public function setMessagingGatewayInfo($messaging_gateway_info) 91 | { 92 | $this->messaging_gateway_info = $messaging_gateway_info; 93 | } 94 | 95 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/DeviceTokenResponse.php: -------------------------------------------------------------------------------- 1 | dtoken1i; 25 | } 26 | 27 | /** 28 | * @param string $dtoken1i 29 | */ 30 | public function setDtoken1i($dtoken1i) 31 | { 32 | $this->dtoken1i = $dtoken1i; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getDeviceTokenVerifier() 39 | { 40 | return $this->dtoken1v; 41 | } 42 | 43 | /** 44 | * @param string $dtoken1v 45 | */ 46 | public function setDtoken1v($dtoken1v) 47 | { 48 | $this->dtoken1v = $dtoken1v; 49 | } 50 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/FindFriendsResponse.php: -------------------------------------------------------------------------------- 1 | results; 34 | } 35 | 36 | /** 37 | * @param Model\Friend[] $results 38 | */ 39 | public function setResults($results) 40 | { 41 | $this->results = $results; 42 | } 43 | 44 | /** 45 | * Timestamp that the Address Book was last Updated 46 | * @return int 47 | */ 48 | public function getLastAddressBookUpdatedDate() 49 | { 50 | return $this->last_address_book_updated_date; 51 | } 52 | 53 | /** 54 | * @param int $last_address_book_updated_date 55 | */ 56 | public function setLastAddressBookUpdatedDate($last_address_book_updated_date) 57 | { 58 | $this->last_address_book_updated_date = $last_address_book_updated_date; 59 | } 60 | 61 | /** 62 | * Whether the results of this request were trimmed. (>30 numbers provided) 63 | * @return boolean 64 | */ 65 | public function isTrimmed() 66 | { 67 | return $this->trimmed; 68 | } 69 | 70 | /** 71 | * @param boolean $trimmed 72 | */ 73 | public function setTrimmed($trimmed) 74 | { 75 | $this->trimmed = $trimmed; 76 | } 77 | 78 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/FriendResponse.php: -------------------------------------------------------------------------------- 1 | object; 19 | } 20 | 21 | /** 22 | * @param object $object 23 | */ 24 | public function setObject($object) 25 | { 26 | $this->object = $object; 27 | } 28 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/FriendsResponse.php: -------------------------------------------------------------------------------- 1 | bests; 31 | } 32 | 33 | /** 34 | * @param string[] $bests 35 | */ 36 | public function setBests($bests) 37 | { 38 | $this->bests = $bests; 39 | } 40 | 41 | /** 42 | * @return Model\Friend[] 43 | */ 44 | public function getFriends() 45 | { 46 | return $this->friends; 47 | } 48 | 49 | /** 50 | * @param Model\Friend[] $friends 51 | */ 52 | public function setFriends($friends) 53 | { 54 | $this->friends = $friends; 55 | } 56 | 57 | /** 58 | * @return Model\AddedFriend[] 59 | */ 60 | public function getAddedFriends() 61 | { 62 | return $this->added_friends; 63 | } 64 | 65 | /** 66 | * @param Model\AddedFriend[] $added_friends 67 | */ 68 | public function setAddedFriends($added_friends) 69 | { 70 | $this->added_friends = $added_friends; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/AddedFriend.php: -------------------------------------------------------------------------------- 1 | add_source; 25 | } 26 | 27 | /** 28 | * @param string $add_source 29 | */ 30 | public function setAddSource($add_source) 31 | { 32 | $this->add_source = $add_source; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getAddSourceType() 39 | { 40 | return $this->add_source_type; 41 | } 42 | 43 | /** 44 | * @param string $add_source_type 45 | */ 46 | public function setAddSourceType($add_source_type) 47 | { 48 | $this->add_source_type = $add_source_type; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/ChatMessage.php: -------------------------------------------------------------------------------- 1 | body; 55 | } 56 | 57 | /** 58 | * @param ChatMessageBody $body 59 | */ 60 | public function setBody($body) 61 | { 62 | $this->body = $body; 63 | } 64 | 65 | /** 66 | * @return string 67 | */ 68 | public function getChatMessageId() 69 | { 70 | return $this->chat_message_id; 71 | } 72 | 73 | /** 74 | * @param string $chat_message_id 75 | */ 76 | public function setChatMessageId($chat_message_id) 77 | { 78 | $this->chat_message_id = $chat_message_id; 79 | } 80 | 81 | /** 82 | * @return int 83 | */ 84 | public function getSeqNum() 85 | { 86 | return $this->seq_num; 87 | } 88 | 89 | /** 90 | * @param int $seq_num 91 | */ 92 | public function setSeqNum($seq_num) 93 | { 94 | $this->seq_num = $seq_num; 95 | } 96 | 97 | /** 98 | * @return int 99 | */ 100 | public function getTimestamp() 101 | { 102 | return $this->timestamp; 103 | } 104 | 105 | /** 106 | * @param int $timestamp 107 | */ 108 | public function setTimestamp($timestamp) 109 | { 110 | $this->timestamp = $timestamp; 111 | } 112 | 113 | /** 114 | * @return ChatMessageHeader 115 | */ 116 | public function getHeader() 117 | { 118 | return $this->header; 119 | } 120 | 121 | /** 122 | * @param ChatMessageHeader $header 123 | */ 124 | public function setHeader($header) 125 | { 126 | $this->header = $header; 127 | } 128 | 129 | /** 130 | * @return string 131 | */ 132 | public function getType() 133 | { 134 | return $this->type; 135 | } 136 | 137 | /** 138 | * @param string $type 139 | */ 140 | public function setType($type) 141 | { 142 | $this->type = $type; 143 | } 144 | 145 | /** 146 | * @return string 147 | */ 148 | public function getId() 149 | { 150 | return $this->id; 151 | } 152 | 153 | /** 154 | * @param string $id 155 | */ 156 | public function setId($id) 157 | { 158 | $this->id = $id; 159 | } 160 | 161 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/ChatMessageBody.php: -------------------------------------------------------------------------------- 1 | type; 34 | } 35 | 36 | /** 37 | * @param string $type 38 | */ 39 | public function setType($type) 40 | { 41 | $this->type = $type; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getText() 48 | { 49 | return $this->text; 50 | } 51 | 52 | /** 53 | * @param string $text 54 | */ 55 | public function setText($text) 56 | { 57 | $this->text = $text; 58 | } 59 | 60 | /** 61 | * @return ChatMessageMedia 62 | */ 63 | public function getMedia() 64 | { 65 | return $this->media; 66 | } 67 | 68 | /** 69 | * @param ChatMessageMedia $media 70 | */ 71 | public function setMedia($media) 72 | { 73 | $this->media = $media; 74 | } 75 | 76 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/ChatMessageHeader.php: -------------------------------------------------------------------------------- 1 | from; 31 | } 32 | 33 | /** 34 | * @param string $from 35 | */ 36 | public function setFrom($from) 37 | { 38 | $this->from = $from; 39 | } 40 | 41 | /** 42 | * @return string[] 43 | */ 44 | public function getTo() 45 | { 46 | return $this->to; 47 | } 48 | 49 | /** 50 | * @param string[] $to 51 | */ 52 | public function setTo($to) 53 | { 54 | $this->to = $to; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getConvId() 61 | { 62 | return $this->conv_id; 63 | } 64 | 65 | /** 66 | * @param string $conv_id 67 | */ 68 | public function setConvId($conv_id) 69 | { 70 | $this->conv_id = $conv_id; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/ChatMessageMedia.php: -------------------------------------------------------------------------------- 1 | media_id; 31 | } 32 | 33 | /** 34 | * @param string $media_id 35 | */ 36 | public function setMediaId($media_id) 37 | { 38 | $this->media_id = $media_id; 39 | } 40 | 41 | /** 42 | * @return string 43 | */ 44 | public function getKey() 45 | { 46 | return $this->key; 47 | } 48 | 49 | /** 50 | * @param string $key 51 | */ 52 | public function setKey($key) 53 | { 54 | $this->key = $key; 55 | } 56 | 57 | /** 58 | * @return string 59 | */ 60 | public function getIv() 61 | { 62 | return $this->iv; 63 | } 64 | 65 | /** 66 | * @param string $iv 67 | */ 68 | public function setIv($iv) 69 | { 70 | $this->iv = $iv; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/ConversationMessages.php: -------------------------------------------------------------------------------- 1 | messages; 25 | } 26 | 27 | /** 28 | * @param Message[] $messages 29 | */ 30 | public function setMessages($messages) 31 | { 32 | $this->messages = $messages; 33 | } 34 | 35 | /** 36 | * @return MessagingAuth 37 | */ 38 | public function getMessagingAuth() 39 | { 40 | return $this->messaging_auth; 41 | } 42 | 43 | /** 44 | * @param MessagingAuth $messaging_auth 45 | */ 46 | public function setMessagingAuth($messaging_auth) 47 | { 48 | $this->messaging_auth = $messaging_auth; 49 | } 50 | 51 | /** 52 | * 53 | * Get all Snaps in this Conversation 54 | * 55 | * @return Snap[] 56 | */ 57 | public function getSnaps(){ 58 | 59 | $snaps = array(); 60 | 61 | foreach($this->getMessages() as $message){ 62 | if($message->isSnap()){ 63 | $snaps[] = $message->getSnap(); 64 | } 65 | } 66 | 67 | return $snaps; 68 | 69 | } 70 | 71 | /** 72 | * 73 | * Get all Chats in this Conversation 74 | * 75 | * @return ChatMessage[] 76 | */ 77 | public function getChats(){ 78 | 79 | $chats = array(); 80 | 81 | foreach($this->getMessages() as $message){ 82 | if($message->isChatMessage()){ 83 | $chats[] = $message->getChatMessage(); 84 | } 85 | } 86 | 87 | return $chats; 88 | 89 | } 90 | 91 | } 92 | -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/ConversationState.php: -------------------------------------------------------------------------------- 1 | user_sequences; 19 | } 20 | 21 | /** 22 | * @param array $user_sequences 23 | */ 24 | public function setUserSequences($user_sequences) 25 | { 26 | $this->user_sequences = $user_sequences; 27 | } 28 | 29 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/FriendStories.php: -------------------------------------------------------------------------------- 1 | username; 25 | } 26 | 27 | /** 28 | * @param string $username 29 | */ 30 | public function setUsername($username) 31 | { 32 | $this->username = $username; 33 | } 34 | 35 | /** 36 | * @return FriendStoryContainer[] 37 | */ 38 | public function getStories() 39 | { 40 | return $this->stories; 41 | } 42 | 43 | /** 44 | * @param FriendStoryContainer[] $stories 45 | */ 46 | public function setStories($stories) 47 | { 48 | $this->stories = $stories; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/FriendStoryContainer.php: -------------------------------------------------------------------------------- 1 | story; 25 | } 26 | 27 | /** 28 | * @param Story $story 29 | */ 30 | public function setStory($story) 31 | { 32 | $this->story = $story; 33 | } 34 | 35 | /** 36 | * @return boolean 37 | */ 38 | public function isViewed() 39 | { 40 | return $this->viewed; 41 | } 42 | 43 | /** 44 | * @param boolean $viewed 45 | */ 46 | public function setViewed($viewed) 47 | { 48 | $this->viewed = $viewed; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/GatewayAuthToken.php: -------------------------------------------------------------------------------- 1 | mac; 25 | } 26 | 27 | /** 28 | * @param string $mac 29 | */ 30 | public function setMac($mac) 31 | { 32 | $this->mac = $mac; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getPayload() 39 | { 40 | return $this->payload; 41 | } 42 | 43 | /** 44 | * @param string $payload 45 | */ 46 | public function setPayload($payload) 47 | { 48 | $this->payload = $payload; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/Message.php: -------------------------------------------------------------------------------- 1 | chat_message != null; 31 | } 32 | 33 | /** 34 | * Check if this Message is a Snap 35 | * @return bool 36 | */ 37 | public function isSnap(){ 38 | return $this->snap != null; 39 | } 40 | 41 | /** 42 | * @return ChatMessage 43 | */ 44 | public function getChatMessage() 45 | { 46 | return $this->chat_message; 47 | } 48 | 49 | /** 50 | * @param ChatMessage $chat_message 51 | */ 52 | public function setChatMessage($chat_message) 53 | { 54 | $this->chat_message = $chat_message; 55 | } 56 | 57 | /** 58 | * @return Snap 59 | */ 60 | public function getSnap() 61 | { 62 | return $this->snap; 63 | } 64 | 65 | /** 66 | * @param Snap $snap 67 | */ 68 | public function setSnap($snap) 69 | { 70 | $this->snap = $snap; 71 | } 72 | 73 | /** 74 | * @return string 75 | */ 76 | public function getIterToken() 77 | { 78 | return $this->iter_token; 79 | } 80 | 81 | /** 82 | * @param string $iter_token 83 | */ 84 | public function setIterToken($iter_token) 85 | { 86 | $this->iter_token = $iter_token; 87 | } 88 | 89 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/MessagingAuth.php: -------------------------------------------------------------------------------- 1 | mac; 25 | } 26 | 27 | /** 28 | * @param string $mac 29 | */ 30 | public function setMac($mac) 31 | { 32 | $this->mac = $mac; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getPayload() 39 | { 40 | return $this->payload; 41 | } 42 | 43 | /** 44 | * @param string $payload 45 | */ 46 | public function setPayload($payload) 47 | { 48 | $this->payload = $payload; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/MessagingGatewayInfo.php: -------------------------------------------------------------------------------- 1 | gateway_server; 25 | } 26 | 27 | /** 28 | * @param string $gateway_server 29 | */ 30 | public function setGatewayServer($gateway_server) 31 | { 32 | $this->gateway_server = $gateway_server; 33 | } 34 | 35 | /** 36 | * @return GatewayAuthToken 37 | */ 38 | public function getGatewayAuthToken() 39 | { 40 | return $this->gateway_auth_token; 41 | } 42 | 43 | /** 44 | * @param GatewayAuthToken $gateway_auth_token 45 | */ 46 | public function setGatewayAuthToken($gateway_auth_token) 47 | { 48 | $this->gateway_auth_token = $gateway_auth_token; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/MyStory.php: -------------------------------------------------------------------------------- 1 | story; 31 | } 32 | 33 | /** 34 | * @param Story $story 35 | */ 36 | public function setStory($story) 37 | { 38 | $this->story = $story; 39 | } 40 | 41 | /** 42 | * @return StoryNote[] 43 | */ 44 | public function getStoryNotes() 45 | { 46 | return $this->story_notes; 47 | } 48 | 49 | /** 50 | * @param StoryNote[] $story_notes 51 | */ 52 | public function setStoryNotes($story_notes) 53 | { 54 | $this->story_notes = $story_notes; 55 | } 56 | 57 | /** 58 | * @return StoryExtras 59 | */ 60 | public function getStoryExtras() 61 | { 62 | return $this->story_extras; 63 | } 64 | 65 | /** 66 | * @param StoryExtras $story_extras 67 | */ 68 | public function setStoryExtras($story_extras) 69 | { 70 | $this->story_extras = $story_extras; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/StoryExtras.php: -------------------------------------------------------------------------------- 1 | view_count; 25 | } 26 | 27 | /** 28 | * @param int $view_count 29 | */ 30 | public function setViewCount($view_count) 31 | { 32 | $this->view_count = $view_count; 33 | } 34 | 35 | /** 36 | * @return int 37 | */ 38 | public function getScreenshotCount() 39 | { 40 | return $this->screenshot_count; 41 | } 42 | 43 | /** 44 | * @param int $screenshot_count 45 | */ 46 | public function setScreenshotCount($screenshot_count) 47 | { 48 | $this->screenshot_count = $screenshot_count; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/StoryNote.php: -------------------------------------------------------------------------------- 1 | viewer; 31 | } 32 | 33 | /** 34 | * @param string $viewer 35 | */ 36 | public function setViewer($viewer) 37 | { 38 | $this->viewer = $viewer; 39 | } 40 | 41 | /** 42 | * @return boolean 43 | */ 44 | public function isScreenshotted() 45 | { 46 | return $this->screenshotted; 47 | } 48 | 49 | /** 50 | * @param boolean $screenshotted 51 | */ 52 | public function setScreenshotted($screenshotted) 53 | { 54 | $this->screenshotted = $screenshotted; 55 | } 56 | 57 | /** 58 | * @return int 59 | */ 60 | public function getTimestamp() 61 | { 62 | return $this->timestamp; 63 | } 64 | 65 | /** 66 | * @param int $timestamp 67 | */ 68 | public function setTimestamp($timestamp) 69 | { 70 | $this->timestamp = $timestamp; 71 | } 72 | 73 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/Model/VerificationNeeded.php: -------------------------------------------------------------------------------- 1 | prompt; 27 | } 28 | 29 | /** 30 | * @param string $prompt 31 | */ 32 | public function setPrompt($prompt) 33 | { 34 | $this->prompt = $prompt; 35 | } 36 | 37 | /** 38 | * @return string 39 | */ 40 | public function getType() 41 | { 42 | return $this->type; 43 | } 44 | 45 | /** 46 | * @param string $type 47 | */ 48 | public function setType($type) 49 | { 50 | $this->type = $type; 51 | } 52 | 53 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/PhoneVerifyResponse.php: -------------------------------------------------------------------------------- 1 | message_format; 28 | } 29 | 30 | /** 31 | * @param string $message_format 32 | */ 33 | public function setMessageFormat($message_format) 34 | { 35 | $this->message_format = $message_format; 36 | } 37 | 38 | /** 39 | * @return string 40 | */ 41 | public function getParam() 42 | { 43 | return $this->param; 44 | } 45 | 46 | /** 47 | * @param string $param 48 | */ 49 | public function setParam($param) 50 | { 51 | $this->param = $param; 52 | } 53 | 54 | /** 55 | * @return string 56 | */ 57 | public function getAction() 58 | { 59 | return $this->action; 60 | } 61 | 62 | /** 63 | * @param string $action 64 | */ 65 | public function setAction($action) 66 | { 67 | $this->action = $action; 68 | } 69 | 70 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/RegisterUsernameResponse.php: -------------------------------------------------------------------------------- 1 | verification_needed; 19 | } 20 | 21 | /** 22 | * @param Model\VerificationNeeded $verification_needed 23 | */ 24 | public function setVerificationNeeded($verification_needed) 25 | { 26 | $this->verification_needed = $verification_needed; 27 | } 28 | 29 | /** 30 | * @return bool 31 | */ 32 | public function isVerificationNeeded(){ 33 | return $this->verification_needed != null; 34 | } 35 | 36 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/SnapTagResponse.php: -------------------------------------------------------------------------------- 1 | imageData; 25 | } 26 | 27 | /** 28 | * @param string $imageData 29 | */ 30 | public function setImageData($imageData) 31 | { 32 | $this->imageData = $imageData; 33 | } 34 | 35 | /** 36 | * @return string 37 | */ 38 | public function getQrPath() 39 | { 40 | return $this->qrPath; 41 | } 42 | 43 | /** 44 | * @param string $qrPath 45 | */ 46 | public function setQrPath($qrPath) 47 | { 48 | $this->qrPath = $qrPath; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/SolveCaptchaResponse.php: -------------------------------------------------------------------------------- 1 | find_friends_enabled; 23 | } 24 | 25 | /** 26 | * @param boolean $find_friends_enabled 27 | */ 28 | public function setFindFriendsEnabled($find_friends_enabled) 29 | { 30 | $this->find_friends_enabled = $find_friends_enabled; 31 | } 32 | 33 | /** 34 | * @return boolean 35 | */ 36 | public function isIsResetPassword() 37 | { 38 | return $this->is_reset_password; 39 | } 40 | 41 | /** 42 | * @param boolean $is_reset_password 43 | */ 44 | public function setIsResetPassword($is_reset_password) 45 | { 46 | $this->is_reset_password = $is_reset_password; 47 | } 48 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/API/Response/StoriesResponse.php: -------------------------------------------------------------------------------- 1 | my_stories; 25 | } 26 | 27 | /** 28 | * @param Model\MyStory[] $my_stories 29 | */ 30 | public function setMyStories($my_stories) 31 | { 32 | $this->my_stories = $my_stories; 33 | } 34 | 35 | /** 36 | * @return Model\FriendStories[] 37 | */ 38 | public function getFriendStories() 39 | { 40 | return $this->friend_stories; 41 | } 42 | 43 | /** 44 | * @param Model\FriendStories[] $friend_stories 45 | */ 46 | public function setFriendStories($friend_stories) 47 | { 48 | $this->friend_stories = $friend_stories; 49 | } 50 | 51 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/Crypto/DeviceToken.php: -------------------------------------------------------------------------------- 1 | dtoken1i = $dtoken1i; 25 | $this->dtoken1v = $dtoken1v; 26 | } 27 | 28 | /** 29 | * 30 | * Initializes the Device Signature. 31 | * 32 | * @param $username string Snapchat Username 33 | * @param $password string Snapchat Password 34 | * @param $timestamp string Login Request Timestamp 35 | * @param $request_token string Login Request Token 36 | */ 37 | public function initDeviceSignatureRegistration($username, $password, $timestamp, $request_token) 38 | { 39 | $data = sprintf("%s|%s|%s|%s", $username, $password, $timestamp, $request_token); 40 | $this->dsig = substr(hash_hmac("sha256", $data, $this->dtoken1v), 0, 20); 41 | } 42 | 43 | /** 44 | * @return string Device Token Identifier 45 | */ 46 | public function getDeviceTokenIdentifier() 47 | { 48 | return $this->dtoken1i; 49 | } 50 | 51 | /** 52 | * @return string Device Token Verifier 53 | */ 54 | public function getDeviceTokenVerifier() 55 | { 56 | return $this->dtoken1v; 57 | } 58 | 59 | /** 60 | * @return string Device Signature 61 | */ 62 | public function getDeviceSignature() 63 | { 64 | return $this->dsig; 65 | } 66 | 67 | /** 68 | * @return string Device Unique ID 69 | */ 70 | public function getDeviceUniqueID() 71 | { 72 | return base64_encode(sha1($this->dtoken1i, true)); 73 | } 74 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/Crypto/StoryCrypto.php: -------------------------------------------------------------------------------- 1 | id = $id; 28 | $this->folder = $folder; 29 | $this->files = $files; 30 | } 31 | 32 | /** 33 | * @return string 34 | */ 35 | public function getId() 36 | { 37 | return $this->id; 38 | } 39 | 40 | /** 41 | * @return string 42 | */ 43 | public function getFolder() 44 | { 45 | return $this->folder; 46 | } 47 | 48 | /** 49 | * @return string[] 50 | */ 51 | public function getFiles() 52 | { 53 | return $this->files; 54 | } 55 | 56 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/Model/MediaPath.php: -------------------------------------------------------------------------------- 1 | blob = $blob; 17 | $this->overlay = $overlay; 18 | } 19 | 20 | /** 21 | * 22 | * Get the File Path of the Blob 23 | * 24 | * @return string 25 | */ 26 | public function getBlobPath(){ 27 | return $this->blob; 28 | } 29 | 30 | /** 31 | * 32 | * Get the File Path of the Overlay 33 | * 34 | * @return string 35 | */ 36 | public function getOverlayPath(){ 37 | return $this->overlay; 38 | } 39 | 40 | /** 41 | * 42 | * Check if the Blob File exists. 43 | * 44 | * @return bool 45 | */ 46 | public function blobExists(){ 47 | return file_exists($this->getBlobPath()); 48 | } 49 | 50 | /** 51 | * 52 | * Check if the Overlay File exists. 53 | * 54 | * @return bool 55 | */ 56 | public function overlayExists(){ 57 | return file_exists($this->getOverlayPath()); 58 | } 59 | 60 | } -------------------------------------------------------------------------------- /vendor/picaboooo/snapchatsdk/src/Snapchat/Util/FileUtil.php: -------------------------------------------------------------------------------- 1 | =5.3.0" 15 | }, 16 | "autoload": { 17 | "psr-4": { 18 | "Psr\\Http\\Message\\": "src/" 19 | } 20 | }, 21 | "extra": { 22 | "branch-alias": { 23 | "dev-master": "1.0.x-dev" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/psr/http-message/src/ResponseInterface.php: -------------------------------------------------------------------------------- 1 | = 5.3. 5 | 6 | [![Build Status](https://travis-ci.org/ralouphie/getallheaders.svg?branch=master)](https://travis-ci.org/ralouphie/getallheaders) 7 | [![Coverage Status](https://coveralls.io/repos/ralouphie/getallheaders/badge.png?branch=master)](https://coveralls.io/r/ralouphie/getallheaders?branch=master) 8 | [![Latest Stable Version](https://poser.pugx.org/ralouphie/getallheaders/v/stable.png)](https://packagist.org/packages/ralouphie/getallheaders) 9 | [![Latest Unstable Version](https://poser.pugx.org/ralouphie/getallheaders/v/unstable.png)](https://packagist.org/packages/ralouphie/getallheaders) 10 | [![License](https://poser.pugx.org/ralouphie/getallheaders/license.png)](https://packagist.org/packages/ralouphie/getallheaders) 11 | 12 | 13 | This is a simple polyfill for [`getallheaders()`](http://www.php.net/manual/en/function.getallheaders.php). 14 | 15 | ## Install 16 | 17 | For PHP version **`>= 5.6`**: 18 | 19 | ``` 20 | composer require ralouphie/getallheaders 21 | ``` 22 | 23 | For PHP version **`< 5.6`**: 24 | 25 | ``` 26 | composer require ralouphie/getallheaders "^2" 27 | ``` 28 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "ralouphie/getallheaders", 3 | "description": "A polyfill for getallheaders.", 4 | "license": "MIT", 5 | "authors": [ 6 | { 7 | "name": "Ralph Khattar", 8 | "email": "ralph.khattar@gmail.com" 9 | } 10 | ], 11 | "require": { 12 | "php": ">=5.6" 13 | }, 14 | "require-dev": { 15 | "phpunit/phpunit": "^5 || ^6.5", 16 | "php-coveralls/php-coveralls": "^2.1" 17 | }, 18 | "autoload": { 19 | "files": ["src/getallheaders.php"] 20 | }, 21 | "autoload-dev": { 22 | "psr-4": { 23 | "getallheaders\\Tests\\": "tests/" 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /vendor/ralouphie/getallheaders/src/getallheaders.php: -------------------------------------------------------------------------------- 1 | 'Content-Type', 16 | 'CONTENT_LENGTH' => 'Content-Length', 17 | 'CONTENT_MD5' => 'Content-Md5', 18 | ); 19 | 20 | foreach ($_SERVER as $key => $value) { 21 | if (substr($key, 0, 5) === 'HTTP_') { 22 | $key = substr($key, 5); 23 | if (!isset($copy_server[$key]) || !isset($_SERVER[$key])) { 24 | $key = str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', $key)))); 25 | $headers[$key] = $value; 26 | } 27 | } elseif (isset($copy_server[$key])) { 28 | $headers[$copy_server[$key]] = $value; 29 | } 30 | } 31 | 32 | if (!isset($headers['Authorization'])) { 33 | if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) { 34 | $headers['Authorization'] = $_SERVER['REDIRECT_HTTP_AUTHORIZATION']; 35 | } elseif (isset($_SERVER['PHP_AUTH_USER'])) { 36 | $basic_pass = isset($_SERVER['PHP_AUTH_PW']) ? $_SERVER['PHP_AUTH_PW'] : ''; 37 | $headers['Authorization'] = 'Basic ' . base64_encode($_SERVER['PHP_AUTH_USER'] . ':' . $basic_pass); 38 | } elseif (isset($_SERVER['PHP_AUTH_DIGEST'])) { 39 | $headers['Authorization'] = $_SERVER['PHP_AUTH_DIGEST']; 40 | } 41 | } 42 | 43 | return $headers; 44 | } 45 | 46 | } 47 | --------------------------------------------------------------------------------