dongtuan8547 2011-03-09 01:04
浏览 12

来自facebook墙的照片来源

i am trying to grab the photos that are being posted to the wall of this page. Below are my codes:

include_once 'facebook.php';
include_once 'config.php';
require 'DropboxUploader.php';

$feed = $facebook->api('/me/feed');
foreach($feed['data'] as $feeds)
{
        if(!$feeds["object_id"]==null)
        {
        echo "Feeds secion", "<br />";
        echo $feeds["picture"], "<br />";
        echo "<img src='{$feeds['picture']}' />", "<br />";
        //echo "This is feed object_id ".$feeds["object_id"], "<br />";
        echo "This is feed id ".$feeds["id"], "<br />";
        $target_path = "uploads/";
        $target_path = $target_path . basename($feeds["picture"]);

        $content = file_get_contents($feeds["source"]);
        file_put_contents($target_path, $content);

        $uploader = new DropboxUploader('testing@hotmail.com', 'testing');
        $uploader->upload($target_path, 'imageStore');

        }


}

I was able to grab the picture which was the thumbnail of that image. I would like to ask how i could grab the actual photo source itself instead of the thumbnail.

Please advice me. Thanks!

  • 写回答

1条回答 默认 最新

  • doulu1325 2011-03-09 09:05
    关注

    After some trying and checking, i guess there is no way i could grab the actual photo from facebook wall as they are all preview thumbnails.

    I went into another approach on this matter. When a photo is posted onto the wall, faceboook will automatically creates(if folder does not exist) a album "Wall Photos" and place the photos inside. I uses this theory to grab the album id and all the photos inside.

    $album = $facebook->api('/'.$app_id.'/albums');
    foreach($album['data'] as $photo)
    {
        if($photo['name']=="Wall Photos")
        {
            $image = $facebook->api('/'.$photo['id'].'/photos');
            photoGrab($image); //function
        }
    }//each of $album foreach
    

    It is not a very ideal way thought. Please advise me if there is any better and efficient ways.

    Thank you!

    评论

报告相同问题?

悬赏问题

  • ¥20 python忆阻器数字识别
  • ¥15 无法输出helloworld
  • ¥15 高通uboot 打印ubi init err 22
  • ¥20 PDF元数据中的XMP媒体管理属性
  • ¥15 R语言中lasso回归报错
  • ¥15 网站突然不能访问了,上午还好好的
  • ¥15 有没有dl可以帮弄”我去图书馆”秒选道具和积分
  • ¥15 semrush,SEO,内嵌网站,api
  • ¥15 Stata:为什么reghdfe后的因变量没有被发现识别啊
  • ¥15 振荡电路,ADS仿真