Not sure how this even works, as the raw PHP has a lot of issues
-
Was hoping you’d reply in StackOverflow:
https://stackoverflow.com/questions/15994628/autopost-to-pinterest/16328639#16328639I 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
- The topic ‘Not sure how this even works, as the raw PHP has a lot of issues’ is closed to new replies.