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

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

问题描述

我有一个博客网站写在php,它发布新的博客帖子到twitter和一个博客ping自动在引擎盖下使用简单的http post请求通过php卷曲。



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



我真正想要的是一个URL和一组params作为http发帖请求。



请注意,这是在新的样式页面上发布到墙上而不是配置文件。



提前感谢。

解决方案

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

 <?php 
$ attachment = array(
'message'=>'这是我的消息',
'name'=>'这是我的演示Facebook应用程序!',
'caption'=>帖子标题,
'link'=>'http://mylink.com',
'description'=>'这是一个描述',
'picture'=>' http://mysite.com/pic.gif',
'actions'=>数组(
数组(
'name'=>'获取搜索',
'link'= >'http://www.google.com'


);

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

上面的代码将邮件发送到你的墙上...如果你想发布到您的朋友或其他墙壁,然后用该用户的Facebook用户标识替换。有关更多信息,请查看API文档。


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.

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?

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.

Thanks in advance.

解决方案

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);

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天全站免登陆