2012-11-08 56 views
1

我使用下面的命令發佈一些圖像:投稿圖像消失

$url_facebook = "https://api.facebook.com/method/stream.publish?message=".$messaggio."&attachment={\"name\":\"".$title."\",\"href\":\"".$action_link."\",\"caption\":\"".$caption."\",\"description\":\"".$description."\",\"media\":[{\"type\":\"image\",\"src\":\"".$image."\",\"href\":\"".$action_link."\"}]}&action_links=[{\"text\":\"".$link_name."\",\"href\":\"".$action_link."\"}]&target_id=".$target_uid."&uid=".$source_uid."&".$site_token.""; 
    simplexml_load_file("".$url_facebook.""); 

圖像I後在壁(一組)被從PHP實時生成。

這是發生了什麼:

  • 我生成圖像,並將其保存到一個文件夾
  • 我的代碼在
  • 我退出腳本
  • 下一次張貼運行腳本(每小時)我刪除所有舊的 創建的圖像,比重複瓦特sayid

我noti CED的圖像剛剛發佈的時候,都存在和存在的FB牆

下一次我啓動腳本(以及因此圖像從我的站點中刪除),他們也消失從Facebook

我明白,上傳到Facebook的圖像,所以他們不再需要我的空間....

是不是這樣?

我這無疑也是因爲,如果我在Facebook上的紅色X看到(在圖像的地方)

和我右鍵單擊「proprerties」,我可以讀:

"https://s-platform.ak.fbcdn.net/www/app_full_proxy.php?app=164286063695472&v=1&size=z&cksum=17f253305254403324260843c7a6989a&src=http%3A%2F%2Fwww.graficisismici.it%2FV6_00%2Ffacebook%2Ffacebook_link_285790.jpg%3F285790" 

所以它似乎是一個真正的原始圖像鏈接 你能解決我的疑問嗎?

回答

0

同時我修改劇本以使用新的圖形API

<?php 

    $user = null; 

    $facebook = new Facebook(array(
     'appId' => FACEBOOK_APP_ID, 
     'secret' => FACEBOOK_SECRET, 
     'cookie' => true 
    )); 

    $user = $facebook->getUser(); // Get the UID of the connected user, or 0 if the Facebook user is not connected. 

    if($user == 0) { 

      /** 
      * Get a Login URL for use with redirects. By default, full page redirect is 
      * assumed. If you are using the generated URL with a window.open() call in 
      * JavaScript, you can pass in display=popup as part of the $params. 
      * 
      * The parameters: 
      * - redirect_uri: the url to go to after a successful login 
      * - scope: comma separated list of requested extended perms 
      */ 

      $login_url = $facebook->getLoginUrl($params = array('scope' => "publish_stream")); 

      echo ("<script> top.location.href='".$login_url."'</script>"); 
    } else { 
     $user_message = "Message"; 
     $titolo = "Titolo"; 
     $caption = "Caption"; 
     $link_name = "Link Name"; 
     $action_link = "Action Link"; 
     $testo = "Text"; 
     $image = "Image Link"; 

     $target_uid = "XXXXXXXX"; // ID where to publish  

     //HTTP POST request to PAGE_ID/feed with the publish_stream 
     $post_url = '/'.$target_uid.'/feed'; 

      try { 
        $params = array(
         'message' => $user_message, 
         'name' => $titolo, 
         'caption' => $caption, 
         'link' => $action_link, 
         'description' => $link_name, 
         'picture' => $image, 
         'actions' => array(
              array(
               'name' => $testo, 
               'link' => $action_link 
              ) 
             ) 
        ); 

        $post = $facebook->api($post_url,"POST",$params); 
       } 
       catch (FacebookApiException $e) { 
        $result = $e->getResult(); 
       } 

    } 

?> 

我只是想有一個澄清的圖像問題。 圖像是否仍然存在? 或者一旦發佈,我可以刪除它們,因爲它們仍然生活在Fb上?

我的問題出自於我在我的網站的錯誤日誌中看到(當在這篇文章的頂部使用舊腳本時)404行錯誤的一行(與從Fb搜索的錯過的圖像有關)

0

我理解,在上傳到Facebook上,所以他們不再需要我的空間圖像....

這是不是這樣的。 Facebook只是將你的內容緩存在他們的CDN中。如果您刪除源照片,當內容從其緩存中刪除時,它們嘗試刷新/重新填充緩存將失敗,並且您的用戶將得到一個損壞的圖像圖標。

圖像是否還存在?或者一旦發佈,我可以刪除它們,因爲它們仍然生活在Fb上?

您不應該刪除它們。