• Hello.

    I have problems with “Image Post – big image with text message” for VK. The same feature for the Facebook works perfect, but VK posts only a text message.
    I see an error in the (debug)log:

    Y:[2015-12-29 07:45:18] – [Posted] [vKontakte – vk_vtpost] – OK – Message Posted | PostID: 11 – test4 |im | Post Link
    [2015-12-29 07:45:18] – [Error] [vKontakte – vk_vtpost] – -=ERROR=- Array ( [postID] => -56179083_12700 [isPosted] => 1 [postURL] => https://vk.com/wall-56179083_12700 [pDate] => 2015-12-29 07:45:18 [err] => -=ERROR=- ) | PostID: 11 – test4 |im
    [2015-12-29 07:45:16] – [Skipped] [Facebook (FB_post)] – -=[Unchecked Account]=- – PostID:11
    [2015-12-29 07:45:16] – [Start =- ]- ——=========#### NEW AUTO-POST REQUEST PostID:(11) Immediate ####=========——
    [2015-12-29 07:45:16] – [*** ID: 11, Type: post]- Status Changed: draft_to_publish. Autopost requested.

    Please, help.

    https://www.ads-software.com/plugins/social-networks-auto-poster-facebook-twitter-g/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter nata-lee

    (@nata-lee)

    Well, I tried to debug, so I changed almost the last line in vk.api.php, added $atts, $postType, $ntOpts:
    if (isset($ret) && $ret!='') return array('postID'=>$ret, 'isPosted'=>1, 'postURL'=>'https://vk.com/wall'.$ret, 'pDate'=>date('Y-m-d H:i:s'), 'err'=>$badOut['Error'], $atts, $postType, $ntOpts);

    and got changed error message
    [Error] [vKontakte - vk_vtpost] - -=ERROR=- Array ( [postID] => -blabla [isPosted] => 1 [postURL] => https://vk.com/wall-blabla [pDate] => 2015-12-30 15:20:30 [err] => -=ERROR=- [0] => [1] => I [2] => ) | PostID:

    So $atts is not defined and it’s null, $postType…. really? In other api (FB) there is a var $fbPostType and it has a value = $ntOpts.
    $ntOpts here is I [2] so… I guess your code would never work.

    Any ideas?

    Plugin Author NextScripts

    (@nextscripts)

    I am not sure why you are comparing Facebook code with VK code. They work 100% differently.

    We just need to send only image URL to Facebook.

    We need to download the whole image internally to the script, save to the temporary folder, and then upload it to VK via either CURLFile class or by reference.

    if you are getting empty $atts it means nxs_uplImgtoVK function (from the same vk.api.php) failed somewhere where it doesn’t log the problem.

    Thread Starter nata-lee

    (@nata-lee)

    Well, I just need to research because the plugin is not work as it should.
    It looks like the plugin is not trying to upload any image.

    This is my $options:
    Array ( [doVK] => 1 [nName] => vk_vtpost [vkAppID] => Myappid [uPass] => [catSel] => 0 [catSelEd] => [postType] => I [attch] => 0 [attchAsVid] => 0 [imgUpl] => 0 [addBackLink] => 0 [msgFrmt] => test098 [rpstDays] => 0 [rpstHrs] => 0 [rpstMins] => 0 [rpstOn] => 0 [rpstStop] => O [rpstOnlyPUP] => 0 [fltrsOn] => 0 [rpstBtwDays] => Array ( ) [url] => https://vk.com/blablabla [vkPgID] => blablabla [apVKAuthResp] => https://api.vkontakte.ru/blank.html#access_token=blabla[vkAppAuthToken] => blabla [vkAppAuthUser] => bla [pgIntID] => -bla [rpstRndMins] => 0 [rpstPostIncl] => 0 [rpstType] => 2 [rpstTimeType] => A [rpstFromTime] => [rpstToTime] => [rpstOLDays] => 30 [rpstNWDays] => 365 [tagsSel] => [tagsSelX] => [vkSvC] => N; [ii] => 0 [pType] => aj [isPosted] => 1 [imgToUse] => [urlToUse] => https://.../2015/12/29/test5/ [imgSize] => ) )

    [imgUpl] => 0 – what does it mean? Where does it stored?

    Thread Starter nata-lee

    (@nata-lee)

    [imgUpl] => 1 – I changed it, and nothing changed.
    What else variables do I need to inspect?
    Where is located the $tmp dir?

    Thread Starter nata-lee

    (@nata-lee)

    Well, I dumped curl

    * Connected to pu.vkontakte.ru (x.x.x.x) port 443 (#0)
    * ALPN, offering http/1.1
    * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
    * successfully set certificate verify locations:
    *   CAfile: /etc/ssl/certs/ca-certificates.crt
      CApath: /etc/ssl/certs
    * SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
    * ALPN, server accepted to use http/1.1
    * Server certificate:
    *        subject: OU=Domain Control Validated; CN=*.vkontakte.ru
    *        start date: Aug  6 02:20:06 2014 GMT
    *        expire date: Aug  6 02:20:06 2016 GMT
    *        subjectAltName: pu.vkontakte.ru matched
    *        issuer: C=US; ST=Arizona; L=Scottsdale; O=GoDaddy.com, Inc.; OU=https://certs.godaddy.com/repository/; CN=Go Daddy Secure Certificate Authority - G2
    *        SSL certificate verify ok.
    > POST /theResponsefrom_photos.getWallUploadServer HTTP/1.1
    Host: pu.vkontakte.ru
    Accept: */*
    Content-Length: 232250
    Expect: 100-continue
    Content-Type: multipart/form-data; boundary=------------------------641810a659126f86
    
    < HTTP/1.1 413 Request Entity Too Large
    < Server: Apache
    < Date: Sat, 02 Jan 2016 07:54:39 GMT
    < Content-Type: text/html
    < Content-Length: 195
    < Connection: close
    <
    * Closing connection 0
    Thread Starter nata-lee

    (@nata-lee)

    Guys… I don’t know what to say. I am not a programmer, I’m just a regular user, but I had to spend 3 days debugging your code, dumping variables and investigating requests and responses.
    And. The plugin has a major bug.

    function nxs_uplImgtoVK($imgURL, $options){
          $postUrl = 'https://api.vkontakte.ru/method/photos.getWallUploadServer?gid='.(str_replace('-','',$options['pgIntID'])).'&access_token='.$options['vkAppAuthToken'];

    URL of vk api is api.vk.com.
    Fix it, please.

    Thank you for your poor help.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Does not work Image Post to VK’ is closed to new replies.