doukun0888 2018-08-25 17:12
浏览 75

我无法理解Pinterest-API-PHP的逻辑

I need to write a script for automatically posting pins from my local LAMP server to my Pinterest account.

require 'vendor/autoload.php'; // include Composer's autoloader

use DirkGroenen\Pinterest\Pinterest;

$pinterest=new Pinterest('*my client id*','*my*app*secret*');

$loginurl=$pinterest->auth->getLoginUrl('https://127.0.0.1', array('read_public'));
echo '<a href=' . $loginurl . '>Authorize Pinterest</a>';

I thought I need to authorize to make some actions such as making pins but the authorization method does not work without REDIRECT_URI. I do not need to have any redirect. I just planned to insert a code below that will created pins.

What steps should I perform to post a pin by PHP script? Should I use redirect to another PHP script which will perform actions what I want? What steps should I perform to post a pin by PHP script?

  • 写回答

1条回答 默认 最新

  • du248227 2018-08-25 18:15
    关注

    Pinterest uses OAuth 2.0 to authenticate requests between your app and your users.

    $loginurl var contain URL, for authorization, you need to click to this URL and authorize, after that you will be able to post

    You can't do it automatically without authorization, and you need redirect_url where Pinterest would be send the token

    评论

报告相同问题?

悬赏问题

  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)