• Resolved imkane

    (@imkane)


    Was hoping you’d reply in StackOverflow:
    https://stackoverflow.com/questions/15994628/autopost-to-pinterest/16328639#16328639

    I posted a bunch of issues with the PHP, am curious to hear your thoughts.

    The login() function doesn’t even work for me, the $token=$cookies[‘csrftoken’]; line isn’t populating $token. Are you sure it’s working on your end? – Kane May 9 at 0:05

    To get the csrf token, I had to replace line 52 of auth.php with preg_match_all(‘/^Set-Cookie:\s*([^;]*)/mi’, $page, $m) and line 54 with parse_str($m[1][1], $cookies); – Kane May 9 at 0:29

    Also, the preg_match_all() on line 72 won’t work because the hidden input fields use single quotes, not double quotes, for example: <input type=’hidden’ name=’_ch’ value=’xc1yqyem’ /> – Kane May 9 at 1:00

    ^ I had to update line 72 to be: $count = preg_match_all(“/<input type=’hidden’\s*name='(.*?)’\s*value='(.*?)’/i”, $form, $hiddenFields); – Kane May 9 at 1:07

    It’s almost as if the Pinterest.com that you’re looking at is much different than the one I’m seeing. Have you accepted the “New Look” that Pinterest pushed out recently?

    Thanks!
    Kane

    https://www.ads-software.com/extend/plugins/lazy-pinner/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author leethompson

    (@leethompson)

    Hello, Yes I am using the new look, I have found an issue with safe_mode and open_basedir being set that causes the errors you are seeing, we are working to resolve these issue and will post a new version shortly.

    Lee

    Thread Starter imkane

    (@imkane)

    Your new version 2.1.4 still can’t even login.

    Heck, it can’t even get the CSRF token:
    This comment from StackOverflow still applies:

    “To get the csrf token, I had to replace line 52 of auth.php with preg_match_all(‘/^Set-Cookie:\s*([^;]*)/mi’, $page, $m) and line 54 with parse_str($m[1][1], $cookies);”

    I’m super confused why it’s working for you, yet simple things like the CSRF token don’t work for me?

    Thread Starter imkane

    (@imkane)

    I’m guessing it’s something unique to my dev environment (I’m testing this local on Windows 7 w/ Apache)

    Thread Starter imkane

    (@imkane)

    Ahh…I moved the script to another web server and the login worked ??

    So it’s clearly something unique with how my local dev env is configured.

    Plugin Author leethompson

    (@leethompson)

    Hello,
    Im glad you got the plugin working, I havent tested this on a windows apache server. I am working on a work around for open_basedir and hopefully can release this soon.

    Lee

    Hi @leethompson and @imkane
    I am trying the script and pinterest says “We’ve detected a bot!”. I get the same thing manually doing a CURL.

    Any idea what is pinterest looking at to determine its a bot? I couldn’t even get the login page.

    Thread Starter imkane

    (@imkane)

    @goalazo,

    Did you set the CURLOPT_USERAGENT to something common?

    Example:
    Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; en-GB)

    Yeah its set to
    Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101206 Ubuntu/10. 10 (maverick) Firefox/3.6.13

    Do you have a working script that I can look at?

    Plugin Author leethompson

    (@leethompson)

    If you download this the script will identify the hidden fields pinterest is using on form submission.

    Lee

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Not sure how this even works, as the raw PHP has a lot of issues’ is closed to new replies.