doufang7385 2010-11-28 01:14
浏览 99

Facebook Graph API状态更新PHP

Ive managed to started working with the Facebook Graph API

Ive been able to use javascript to redirect to the permissions allow page where Ive specified "publish_stream", Ive received a valid access_token

I want to update the user's status. Following Facebook's documentation I am attempting to post to:

https://graph.facebook.com/{user_id}/feed/access_token=x&message=y

(where {user_id} is the user's facebook uid etc)

Ive tried using CURL, as well as file_get_contents so both as POST and GET requests. The only response I received is a list of the user's previous statuses, it will not update the status with the data im sending.

I must be missing something. The documentation says that's all I need

  • 写回答

1条回答 默认 最新

  • duanpai6581 2011-01-05 18:59
    关注

    Tell me if you're still having problems with this code as I have a completed version which this computer doesn't have saved on it! Anyhow! One main thing I've notices is the extra '/' in your url:

    https://graph.facebook.com/{user_id}/feed/access_token=x&message=y

    should be:

    https://graph.facebook.com/{user_id}/feed?access_token=x&message=y
    

    and the code that I built from was

    curl -F 'access_token=...' \

    -F 'message=Hello, Arjun. I like this new API.' \

    https://graph.facebook.com/arjun/feed
    

    and I got this code from here.

    I hope this helps,

    Jon

    评论

报告相同问题?

悬赏问题

  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)