Property | Type | Description | |
---|---|---|---|
$csrfToken | string | ||
$filePathToUpload | string | ||
$httpClient | seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
$lastError | array | null | ||
$loggedIn | boolean | ||
$postFileData | string | ||
$requestHeaders | array | Common headers needed for every query. |
Method | Description | |
---|---|---|
__construct ( seregazhuk\PinterestBot\Api\Contracts\HttpClient $http ) | ||
autoLogin ( string $username ) : boolean | Load cookies for this username and check if it was logged in. | |
clearToken ( ) | Clear token information. | |
createQuery ( array $data = [], array $bookmarks = [] ) : string | Create request string. | |
createRequestData ( array $data = [], array $bookmarks = [] ) : array | ||
exec ( string $resourceUrl, string $postString = '' ) : string | Executes request to Pinterest API. | |
getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
getLastError ( ) : array | null | ||
isLoggedIn ( ) : boolean | Get current auth status. | |
login ( ) | Mark client as logged. | |
logout ( ) | Mark client as logged out. | |
setTokenFromCookies ( ) | Trying to get csrf token from cookies. | |
upload ( string $pathToFile, string $url ) : string |
Method | Description | |
---|---|---|
buildFilePostData ( string $delimiter ) | ||
getContentTypeHeader ( ) : array | If we are uploading file, we should build boundary form data. Otherwise it is simple urlencoded form. | |
getDefaultHttpHeaders ( ) : array | ||
getHttpHeaders ( ) : array | ||
makeHeadersForUpload ( ) : array |
public __construct ( seregazhuk\PinterestBot\Api\Contracts\HttpClient $http ) | ||
$http | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
protected buildFilePostData ( string $delimiter ) | ||
$delimiter | string |
protected getContentTypeHeader ( ) : array | ||
return | array |
public getHttpClient ( ) : seregazhuk\PinterestBot\Api\Contracts\HttpClient | ||
return | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
public setTokenFromCookies ( ) |
protected HttpClient,seregazhuk\PinterestBot\Api\Contracts $httpClient | ||
return | seregazhuk\PinterestBot\Api\Contracts\HttpClient |
protected array $requestHeaders | ||
return | array |