FS Poster - Best Auto Poster & Scheduler Plugin For WordPress

FS Poster — Auto Poster & Scheduler Plugin For WordPress v7.1.9

No permission to download

Lancel

New member
Oct 29, 2019
15
2
3
Ok friend, the problem is in the account settings.
Apparently pinterest has very limited to his country Brazil in terms of images.
If you change your country in the Pinterest settings for example to Peru or any other you will see how it is published successfully.

The language I left in Portuguese.
Thanks bro you save the day! as you said i tried with a different business account and its work!
 

skypeleft

Active member
Aug 10, 2019
401
71
28
tested for pinterest and i got error: Error! Please check the data and try again!
for cookies method, any help? thanks
 

lgokul

Well-known member
Babiato Lover
Null Master
Trusted Uploader
Jun 26, 2019
998
1,600
93
32
Planeta Vegeta
tested for pinterest and i got error: Error! Please check the data and try again!
for cookies method, any help? thanks
You have to create a board in advance in your account.
Then add the account on the poster and your board should appear on it.

If this does not work change the country in the account settings to Peru for the moment and test if it works.

PS: Only the country, not the language.
 
  • Like
Reactions: skypeleft

lgokul

Well-known member
Babiato Lover
Null Master
Trusted Uploader
Jun 26, 2019
998
1,600
93
32
Planeta Vegeta
bro, it is installed but facing the same problem
Are the videos on your server or on an external one?
Could you give me a user to access your wordpress to check where the error originates? Send them by private message.
Cheers
 

skypeleft

Active member
Aug 10, 2019
401
71
28
You have to create a board in advance in your account.
Then add the account on the poster and your board should appear on it.

If this does not work change the country in the account settings to Peru for the moment and test if it works.

PS: Only the country, not the language.
many thanks pro, it worked :D i has change to USA
 

skypeleft

Active member
Aug 10, 2019
401
71
28
Go to:
fs-poster/App/Lib/pinterest/PinterestCookieApi.php


Replace all content:
Code:
<?php

namespace FSPoster\App\Lib\pinterest;

use FSPoster\App\Providers\Helper;
use GuzzleHttp\Client;
use GuzzleHttp\Cookie\CookieJar;

class PinterestCookieApi
{

    /**
     * @var \GuzzleHttp\Client
     */
    private $client;

    public function __construct( $cookie , $proxy )
    {
        $csrf_token = base64_encode( microtime(1) . rand(0, 99999) );

        $cookieJar  = new CookieJar(false , [
            ["Name" => "_pinterest_sess", "Value"  => $cookie,  "Domain" => ".pinterest.com","Path" => "/","Max-Age" => null,"Expires" => null,"Secure" => false,"Discard" => false,"HttpOnly" => false,"Priority" => "HIGH"],
            ["Name" => "csrftoken", "Value"  => $csrf_token,  "Domain" => ".pinterest.com","Path" => "/","Max-Age" => null,"Expires" => null,"Secure" => false,"Discard" => false,"HttpOnly" => false,"Priority" => "HIGH"]
        ]);

        $this->client    = new Client([
            'cookies'             =>    $cookieJar,
            'allow_redirects'    =>    [ 'max' => 10 ],
            'proxy'                =>    empty($proxy) ? null : $proxy,
            'verify'            =>    false,
            'http_errors'        =>    false,
            'headers'            =>    [
                'User-Agent'    => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0' ,
                'x-CSRFToken'   =>  $csrf_token
            ]
        ]);
    }

    public function sendPost( $boardId , $title, $message , $link , $images )
    {
        $imageUrl = reset($images);
        if( empty( $imageUrl ) )
        {
            return [
                'status'    =>    'error',
                'error_msg'    =>    esc_html__('Image not fount for pin to board!')
            ];
        }

        $uploadedImage = $this->uploadImage( $imageUrl );
        if( $uploadedImage[0] == false )
        {
            return [
                'status'    =>    'error',
                'error_msg'    =>    $uploadedImage[1]
            ];
        }

        $sendData = [
            "options"   =>  [
                "board_id"              =>  $boardId,
                "field_set_key"         =>  "create_success",
                "skip_pin_create_log"   =>  true,
                "description"           =>  $message,
                "link"                  =>  $link,
                "title"                 =>  $title,
                "image_url"             =>  $uploadedImage[1],
                "method"                =>  "uploaded",
                "upload_metric"         =>   ["source"  =>  "pinner_upload_standalone"]
            ],
            "context" =>  []
        ];

        try
        {
            $response = (string)$this->client->post( 'https://www.pinterest.com/resource/PinResource/create/' , [
                'form_params' => [
                    'data'  =>    json_encode( $sendData )
                ]
            ])->getBody();
            $response = json_decode( $response, true );
        }
        catch( \Exception $e )
        {
            $response = [];
        }

        $pinId = isset( $response['resource_response']['data']['id'] ) ? $response['resource_response']['data']['id'] : '';
        if( empty( $pinId ) )
        {
            return [
                'status'    => 'error',
                'error_msg'    => isset($result['resource_response']['message']) ? esc_html($result['resource_response']['message']) : esc_html__('Could not upload the image!')
            ];
        }
        else
        {
            return [
                'status'    => 'ok',
                'id'        => $pinId
            ];
        }
    }

    private function uploadImage( $image )
    {
        try
        {
            $response = (string)$this->client->post( 'https://www.pinterest.com/upload-image/' , [
                'multipart'    =>    [
                    [
                        'name'      => 'img',
                        'contents'  => file_get_contents( $image ),
                        'filename'  => 'blob',
                        'headers'   => ['Content-Type' => 'image/jpeg']
                    ]
                ]
            ])->getBody();
            $response = json_decode( $response, true );
        }
        catch( \Exception $e )
        {
            return [ false, $e->getMessage() ];
        }

        return isset( $response['image_url'] ) ? [ true, $response['image_url'] ] : [ false, ( isset($result['resource_response']['message']) ? $result['resource_response']['message'] : esc_html__('Could not upload the image!') ) ];
    }

    public function getAccountData( )
    {
        try
        {
            $response = (string)$this->client->get( 'https://www.pinterest.com/resource/HomefeedBadgingResource/get/' )->getBody();
        }
        catch( \Exception $e )
        {
            $response = '';
        }

        $result = json_decode( $response, true );

        $id         = isset($result['client_context']['user']['id']) ? $result['client_context']['user']['id'] : '';
        $image      = isset($result['client_context']['user']['image_medium_url']) ? $result['client_context']['user']['image_medium_url'] : '';
        $username   = isset($result['client_context']['user']['username']) ? $result['client_context']['user']['username'] : '';
        $full_name  = isset($result['client_context']['user']['full_name']) ? $result['client_context']['user']['full_name'] : '';

        if( empty( $id ) || empty( $username ) )
        {
            Helper::response( false, isset($result['resource_response']['message']) ? esc_html($result['resource_response']['message']) : esc_html__('Error! Please check the data and try again!', 'fs-poster') );
        }

        return [
            'id'            =>    $id,
            'full_name'        =>    $full_name,
            'profile_pic'    =>    $image,
            'username'        =>    $username
        ];
    }

    public function getBoards( $userName )
    {
        $data = [
            "options"   =>  [
                "isPrefetch"            =>  false,
                "privacy_filter"        =>  "all",
                "sort"                  =>  "custom",
                "field_set_key"         =>  "profile_grid_item",
                "username"              =>  $userName,
                "page_size"             =>  25,
                "group_by"              =>  "visibility",
                "include_archived"      =>  true,
                "redux_normalize_feed"  =>  true
            ],
            "context"   =>  []
        ];

        $boardsArr = [];
        $bookmark = '';

        while( true )
        {
            if( !empty( $bookmark ) )
            {
                $data['options']['bookmarks'] = [ $bookmark ];
            }

            try
            {
                $response = (string)$this->client->get( 'https://www.pinterest.com/resource/BoardsResource/get/?data=' . urlencode( json_encode( $data ) ) )->getBody();
                $response = json_decode( $response, true );
            }
            catch( \Exception $e )
            {
                $response = [];
            }

            if( !isset( $response['resource_response']['data'] ) || !is_array( $response['resource_response']['data'] ) )
            {
                $boards = [];
            }
            else
            {
                $boards = $response['resource_response']['data'];
            }

            foreach ( $boards AS $board )
            {
                $boardsArr[] = [
                    'id'    =>  $board['id'],
                    'name'  =>  $board['name'],
                    'url'   =>  ltrim( $board['url'], '/' ),
                    'cover' =>  isset($board['image_cover_url']) ? $board['image_cover_url'] : ''
                ];
            }

            if( isset( $response['resource_response']['bookmark'] ) && is_string( $response['resource_response']['bookmark'] ) && !empty( $response['resource_response']['bookmark'] ) && $response['resource_response']['bookmark'] != '-end-' )
            {
                $bookmark = $response['resource_response']['bookmark'];
            }
            else
            {
                break;
            }
        }

        return $boardsArr;
    }

}

And try now and report please

me too, i got error image when auto post to pinterest, hmm the author can't fix that?
i hope your fix can working fine
 

lgokul

Well-known member
Babiato Lover
Null Master
Trusted Uploader
Jun 26, 2019
998
1,600
93
32
Planeta Vegeta
me too, i got error image when auto post to pinterest, hmm the author can't fix that?
i hope your fix can working fine
Hello, no longer pay attention to that, your problem was the country in the settings of pinterest. We solve it by changing the country.
 
  • Like
Reactions: Lancel

lgokul

Well-known member
Babiato Lover
Null Master
Trusted Uploader
Jun 26, 2019
998
1,600
93
32
Planeta Vegeta
Thanks for your quick response, but I am trying this into my development environment and I am not using any cache plugin out there.
If you wish I can provide you admin credentials if you can help me out.
Thanks in advance.
Yes please send your cpanel credentials and access to wordpress to review it by private message
 

yahia ashraf

Active member
Trusted Uploader
May 6, 2019
184
83
28
Egypt
www.dokkanashop.com
@lgokul
hi man 😁 i have problem in cookie method of facebook i cant use proxy
in console i have these errors
www.paypalobjects.com/en_PE/i/scr/pixel.gif:1 Failed to load resource: the server responded with a status of 404 ()
and
admin.php?page=fs-poster&tab=fb:1 Uncaught TypeError: $ is not a function
at HTMLDivElement.onclick (admin.php?page=fs-poster&tab=fb:1)
onclick @ admin.php?page=fs-poster&tab=fb:1
 

lgokul

Well-known member
Babiato Lover
Null Master
Trusted Uploader
Jun 26, 2019
998
1,600
93
32
Planeta Vegeta
@lgokul
hi man 😁 i have problem in cookie method of facebook i cant use proxy
in console i have these errors
www.paypalobjects.com/en_PE/i/scr/pixel.gif:1 Failed to load resource: the server responded with a status of 404 ()
and
admin.php?page=fs-poster&tab=fb:1 Uncaught TypeError: $ is not a function
at HTMLDivElement.onclick (admin.php?page=fs-poster&tab=fb:1)
onclick @ admin.php?page=fs-poster&tab=fb:1
Could you lend me your private proxy server to try on my server if I get the error?
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu