你如何在 facebook 页面(不是个人资料)上发布到墙上 [英] How do you post to the wall on a facebook page (not profile)

查看:28
本文介绍了你如何在 facebook 页面(不是个人资料)上发布到墙上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用 php 编写的博客网站,它使用通过 php curl 传递的简单 http 帖子请求自动将新博客帖子发布到 twitter 和博客 ping.

I have a blog site written in php and it posts new blog posts to twitter and a blog ping automatically under the hood using simple http post requests passed using php curl.

我有一个博客网站的 Facebook 页面,并希望将更新发布到页面的墙上,有没有简单的方法可以做到这一点?

I have a facebook page for the blog site and want the updates to be posted to the wall on the page, is there a simple way to do this?

我真正想要的是一个 url 和一组参数,以作为 http post 请求打包.

What I really want is a url and set of params to parcel up as an http post request.

请注意,这是张贴在新样式页面上的墙上,而不是个人资料.

Note that this is to post to the wall on a new style page not a profile.

提前致谢.

推荐答案

github<获取 PHP SDK 并运行以下代码:

Get PHP SDK from github and run the following code:

<?php
$attachment = array(
    'message' => 'this is my message',
    'name' => 'This is my demo Facebook application!',
    'caption' => "Caption of the Post",
    'link' => 'http://mylink.com',
    'description' => 'this is a description',
    'picture' => 'http://mysite.com/pic.gif',
    'actions' => array(
        array(
            'name' => 'Get Search',
            'link' => 'http://www.google.com'
        )
    )
);

$result = $facebook->api('/me/feed/', 'post', $attachment);

上面的代码会将消息发布到您的墙上...如果您想发布到您的朋友或其他人的墙上,请将 me 替换为该用户的 Facebook 用户 ID..for更多信息请查看 API 文档.

the above code will Post the message on to your wall... and if you want to post onto your friends or others wall then replace me with the Facebook User Id of that user..for further information look out the API Documentation.

这篇关于你如何在 facebook 页面(不是个人资料)上发布到墙上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆