From 225bb0ea3ffc02480edcd49b4b6269f406290b35 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Thu, 7 Aug 2014 08:06:23 +0200 Subject: [PATCH] fbsync/fbpost: Trying to be able to more often fetch pictures in its original size. --- fbpost/fbpost.php | 2 +- fbsync/fbsync.php | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fbpost/fbpost.php b/fbpost/fbpost.php index c5b791831..579fb148c 100644 --- a/fbpost/fbpost.php +++ b/fbpost/fbpost.php @@ -1055,7 +1055,7 @@ function fbpost_fetchwall($a, $uid) { if (($type == "photo") AND isset($item->object_id)) { logger('fbpost_fetchwall: fetching fbid '.$item->object_id, LOGGER_DEBUG); - $url = "https://graph.facebook.com/v2.0/".$item->object_id."/?access_token=".$access_token; + $url = "https://graph.facebook.com/".$item->object_id."?access_token=".$access_token; $feed = fetch_url($url); $data = json_decode($feed); if (isset($data->images)) { diff --git a/fbsync/fbsync.php b/fbsync/fbsync.php index e558cb9ac..fe5b6faf0 100644 --- a/fbsync/fbsync.php +++ b/fbsync/fbsync.php @@ -373,13 +373,14 @@ function fbsync_createpost($a, $uid, $self, $contacts, $applications, $post, $cr if (isset($media->photo->fbid)) { logger('fbsync_createpost: fetching fbid '.$media->photo->fbid, LOGGER_DEBUG); - $url = "https://graph.facebook.com/v2.0/".$media->photo->fbid."/?access_token=".$access_token; + $url = "https://graph.facebook.com/".$media->photo->fbid."?access_token=".$access_token; $feed = fetch_url($url); $data = json_decode($feed); if (isset($data->images)) { $preview = $data->images[0]->source; - logger('fbsync_createpost: got fbid image '.$preview, LOGGER_DEBUG); - } + logger('fbsync_createpost: got fbid '.$media->photo->fbid.' image '.$preview, LOGGER_DEBUG); + } else + logger('fbsync_createpost: error fetching fbid '.$media->photo->fbid.' '.print_r($data, true), LOGGER_DEBUG); } }