gpt4 book ai didi

facebook - 我想创建带有网站预览的帖子

转载 作者:行者123 更新时间:2023-12-04 04:59:49 25 4
gpt4 key购买 nike

我想创建一个带有网站预览的帖子。它必须与屏幕截图相似。

enter image description here

如何创建带有 Web 预览的帖子?我想在页面上添加它。

NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:@"Post with web preview",  @"message", nil];
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:@"%@/feed", myself.pageID]
parameters:dict HTTPMethod:@"POST" completionHandler:nil];

最佳答案

有关在此处发布链接(您称之为“带有网站预览的发布”)的更多信息:
http://developers.facebook.com/docs/reference/api/link/

我假设您的 Facebook APP 已经设置了权限,并且您正在使用 PHP-sdk 类。无论如何,任何语言的过程都是相同的,只是改变了你编写它的方式。此外,您需要具有适当权限集的用户访问 token 。

使用 Facebook 的 PHP-sdk,过程将是:

// Load FB class, and init it
require_once("facebook.php");

$config = array();
$config['appId'] = 'YOUR_APP_ID';
$config['secret'] = 'YOUR_APP_SECRET';

$facebook = new Facebook($config);

// You set the User Access Token (you need to have it previously to this: Because you
// requested before, or because you obtain it from Facebook)
$facebook->setAccessToken( $user_access_token );

try {
// Set the link params:
if ( isset($config['link']) ) {
$args = array(
'link' => $link_url //Url to be linked
, 'name' => $link_titulo //Box title
, 'description' => $link_descripcion //Box Description
, 'picture' => $link_foto //Photo to be posted
, 'message' => $link_message //Message over the "link box"
);

// Post in the User/FB_Page wall
$facebook->api('/me/feed', 'post', $args);
}
} catch (FacebookApiException $e) {
$fbError = $e->getResult();

$result = array(
'tipo' => 'error'
, 'code' => $fbError['error']['code']
, 'text' => $fbError['error']['message']
);

print_r($result);
}

更新

阅读您对我的评论的回答后,我认为您只是在寻找 CSS 和布局。您可以在此处找到实现帖子格式的内容:

http://jsfiddle.net/5NYD5/3/

关于facebook - 我想创建带有网站预览的帖子,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16286879/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com