【问题标题】:Facebook API post: How to get larger thumbnail?Facebook API 帖子:如何获得更大的缩略图?
【发布时间】:2013-10-21 13:02:57
【问题描述】:

Facebook 上有这个新的缩略图视图(请参见本文下方的图片)。但是我尝试过的每一个命令或属性,在使用 api 发布时都没有得到这个......

这就是我发布活动现在的样子:

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

这是 fb 用于手动发布的 og:image 行:

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

请相信我,$og_image 和 $pic2 是完全相同的 url,没有缩略图,完全质量,远远超过 720p。

我将非常感谢任何关于此问题的不是“使用?type=large”或某事的意见。像那样。

【问题讨论】:

  • 创建新标签“缩略图”至少需要 1500 分。 gtfo! -.-
  • 根据 FB 开发者小组中的一些讨论,目前似乎只有通过 FB.ui(或直接在 Facebook 上)发布的帖子才能获得更大的图像——但通过 API 发布的帖子却没有。 (它们在目标墙上看起来很大,但在提要中仍然很小。)
  • 是的,这正是问题所在。所以没有解决办法吗? :(
  • lightningsoul.com/media/img/screenshot/… 所以我刚刚用 FB.ui 和重定向 URL 测试了 FB JS SDK,两者都没有使用大缩略图(img 是 1080p!)......现在呢? :(
  • 你有没有通过api找到任何东西?

标签: php facebook image facebook-graph-api image-size


【解决方案1】:

所以现在不可能使用 API 来执行此操作,我正在使用一种解决方法,尽管它可能会令人沮丧。这是我的内容左侧的分享按钮系统。

可以在 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;
}

希望 FB 会在某个时候解决这个问题。如果是这样,我当然会在这里通知您。

【讨论】:

    【解决方案2】:

    这已通过服务器上的设计更新修复(我使用的是测试版服务器,所以我看到的东西更早)。

    最后,感谢 Facebook!

    【讨论】:

    • 你能告诉我怎么做这样的缩略图吗?
    • 如果您的原始图像源足够大,可以生成更大的缩略图,则会自动拉取。
    【解决方案3】:

    这段代码非常适合我:

     $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'))}");
     }
    

    【讨论】:

      猜你喜欢
      • 2015-01-08
      • 2015-03-23
      • 2015-10-24
      • 2014-02-17
      • 2014-10-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-08
      相关资源
      最近更新 更多