简体   繁体   English

Facebook API帖子:如何获得更大的缩略图?

[英]Facebook API post: How to get larger thumbnail?

There is this new thumbnail view on Facebook (see image beneath this text). Facebook上有这个新的缩略图视图(见本文下方的图片)。 But every command or property I tried, I never get this when posting with the api... 但是我尝试过的每一个命令或财产,在用api发布时都没有得到这个...

This is how my post event looks like right now: 这就是我的帖子事件现在的样子:

 $status = $facebook->api('/me/feed', 'POST', array('access_token' =>     $page_access_token, 'fields' => 'picture.height(960).width(1833)', 'message' => $text, 'icon' => 'http://www.renoi.de/images/lg.jpg', 'link' => $link, 'name' => $title, 'user_generated' => 'true', 'images[0]' => $pic2, 'source' => $pic2, 'height' => '960', 'width' => '1833')); 

And this is the og:image line that fb takes for manual posting: 这是fb用于手动发布的og:image行:

  <meta property="og:image" content="<?php echo $og_image; ?>" />

Please believe me that $og_image and $pic2 are exactly the same url, none thumbnail, full quality, far beyond 720p. 请相信我$ og_image和$ pic2完全相同的网址,没有缩略图,完整的质量,远远超过720p。

I would highly appreciate any input on this matter that is not "use ?type=large" or sth. 我非常感谢有关此问题的任何意见,而不是“使用?类型=大”或某事。 like that. 像那样。

在此输入图像描述

So now that it is IMPOSSIBLE to do this with the API I am using a workaround as frustrating as it may be. 所以现在使用API​​执行此操作是不可能的,我使用的解决方法尽管令人沮丧。 It is a share button system on the left of my content. 它是我内容左侧的分享按钮系统。

The result on facebook can be seen here (actually pretty cool because it shifts more results into each other): http://lightningsoul.com/media/img/screenshot/likes_on_facebook_share_content.png Facebook上的结果可以在这里看到(实际上非​​常酷,因为它将更多的结果转移到彼此): http//lightningsoul.com/media/img/screenshot/likes_on_facebook_share_content.png

// Will get your actual browser address and share it

<?php     $thisadress = $_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; ?>

 <div id="fblikem">
      <!-- AddThis Button BEGIN -->
      <div class="addthis_toolbox addthis_default_style addthis_32x32_style">
      <a class="addthis_button_preferred_1" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_preferred_2" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_preferred_3" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_preferred_4" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_button_compact" addthis:url="<?php echo $thisadress; ?>"></a>
      <a class="addthis_counter addthis_bubble_style" addthis:url="<?php echo $thisadress; ?>"></a>
      </div>
    </div>
//And the CSS to make it stay on the left side of your content (centered 1280px wide)
 #fblikem_vertical
{
  position: fixed;
  top: 50%;
  left: 50%;
  height: 200px;
  width: 100px;
  margin-left: -715px;
  margin-top: -100px;
  z-index: 1000;
}

Hopefully FB will fix this at some point. 希望FB能在某些时候解决这个问题。 If so I will, of course, inform you on here. 如果是这样,我当然会在这里通知你。

This is fixed with the design update immenent on the servers (I am using a beta server, so I am seeing things earlier). 这是通过服务器上的设计更新来解决的(我正在使用测试版服务器,所以我之前看到的是事情)。

Finally, thank you Facebook! 最后,谢谢你的Facebook!

fb api帖子中的全角缩略图

This code could work perfect for me: 这段代码对我来说非常合适:

 $appid = 'xxxxxxx';
 $appsecret = 'xxxxxxxx';
 $pageId = $pageid;    
 $msg = $title;

 $title = $facebook_title;

 $uri = $url;

 $desc = $intro_text;

 $pic = $todir;

 $action_name = 'Go to 1tvnews';

 $action_link = $url;

$facebook = new Facebook(array(
 'appId' => $appid,

 'secret' => $appsecret,

 'cookie' => false,
 ));

$user = $facebook->getUser();

// Contact Facebook and get token

 if ($user) {

 // you're logged in, and we'll get user acces token for posting on the wall

 try {

 $page_info = $facebook->api("/$pageId?fields=access_token");

 if (!empty($page_info['access_token'])) {

 $attachment = array(

 'access_token' => $page_info['access_token'],

  'message'=> $msg,

'from' => $appid,

'to' => $pageid,

'caption' =>'1tvnews.af', 


'name' =>$facebook_title ,

'link' => $uri,

'picture' => $todir2,
            'description' => $intro_text
 );

$status = $facebook->api("/$pageId/feed", "post", $attachment);

 } 
else
 {
 $status = 'No access token recieved';
 }
 } catch (FacebookApiException $e) {
 error_log($e);
 $user = null;
 }
 } 
else 
{
 // you're not logged in, the application will try to log in to get a access token

header("Location:{$facebook->getLoginUrl(array('scope' => 
'photo_upload,user_status,publish_stream,user_photos,manage_pages'))}");
 }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM