dtiu94034 2013-03-21 15:17 采纳率: 0%
浏览 31

以编程方式发布到Facebook页面而不是手动[关闭]

I need to know how to post statuses programatically on a facebook page. My aim is to use this in combination with cron. I'm not sure of how to do things because there is no information about the logged user and the facebook API won't let me post without permissions.

Is there any way to achieve this?

P.S: I tried to google but all the results were about posting to page when the admin manually triggers it.

  • 写回答

1条回答 默认 最新

  • douyou1937 2013-03-21 15:38
    关注

    Yes you can, by requesting an extended token and saving it on the database when you login with the admin account.

    Everytime you access an app wich you already granted permissions a token is generated, if you store that token on your database along with the id of the user, you can use it for the next 60 days(I'm not sure if it's really 60 or 30 days ), after that the token expires, to make sure that doesn't happen you just have to visit the app once a month to renew the token.

    If you use php sdk you can get that extended token by doing this:

    $facebook->setExtendedAccessToken();
    $access_token = $facebook->getAccessToken();
    

    You can read more about it here: https://developers.facebook.com/docs/howtos/login/extending-tokens/

    评论

报告相同问题?

悬赏问题

  • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
  • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
  • ¥30 python代码,帮调试
  • ¥15 #MATLAB仿真#车辆换道路径规划
  • ¥15 java 操作 elasticsearch 8.1 实现 索引的重建
  • ¥15 数据可视化Python
  • ¥15 要给毕业设计添加扫码登录的功能!!有偿
  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥100 Jenkins自动化部署—悬赏100元