Facebook Event Picture from API - facebook

I seem to have uncovered a bug on the Facebook API.
This is related to the picture related to an event.
When retrieving pictures through the graph for profiles and events you should use the following link:
http://graph.facebook.com/{eventid}/picture
For events that have already occurred (i.e in the past) this works as expected, but when you try to retrieve the picture for a forthcoming event, such as:
https://graph.facebook.com/323879667682222/picture
The actual image can not be found and the default grey icon is shwown.
(ps. the link above is related to an event scheduled to occur on 3rd May)
Can you please confirm that this is a bug, and if there is any other way to retrieve event images from the graph.
Thanks,
Wez

You can retrieve the event profile image with an FQL query like this:
SELECT pic, pic_square, pic_small, pic_big FROM event WHERE eid=EVENT_ID
This call returns urls to the event profile image in 4 sizes:
pic - maximum width of 100px and a maximum height of 300px.
pic_square - width and height of 50px.
pic_small - maximum width of 50px and a maximum height of 150px.
pic_big - maximum width of 200px and a maximum height of 600px.
You can read more about the event table fields in the Facebook Developer pages: FQL Event table.

it is indeed a bug, came across the same. I'm doing a FQL query now:
$url = 'http://api.facebook.com/method/fql.query?query=select name, pic_small, pic_big, pic, host, description, start_time, end_time, location, venue from event where eid="'.$post.'"';
if($sxe = new SimpleXMLElement($url, NULL, TRUE)){
$urlimg = $sxe->event->pic_big;
}
or with the facebook php api:

Related

How are text images processed by Facebook?

This code is processed as goku image on FB chat:
[[236823566443944]][[236823583110609]][[236823586443942]][[236823596443941]][[236823609777273]]
[[236823629777271]][[236823636443937]][[236823649777269]][[236823663110601]][[236823673110600]]
[[236823683110599]][[236823686443932]][[236823696443931]][[236823699777264]][[236823709777263]]
[[236823716443929]][[236823733110594]][[236823736443927]][[236823749777259]][[236823753110592]]
[[236823756443925]][[236823759777258]][[236823769777257]][[236823779777256]][[236823783110589]]
[[236823789777255]][[236823793110588]][[236823796443921]][[236823806443920]][[236823809777253]]
How FB creates image from this? I found the code on symbols-n-emoticons in comments below, copied&pasted into FB chat and - black magic - the image was there.
So I took your example and did some testing. If yout right click on the image in chat and look at it URL, you can find following:
https://fbcdn-sphotos-d-a.akamaihd.net/hphotos-ak-ash4/227547_236823636443937_1841629131_n.jpg
It's one tile from the goku image. The middle part of the URL corresponds to one value in you code. So this code are actually shortcuts to images stored on FB servers, and the chat window simply replaces the code with image.
I think it could be due to latest update in FB, which allows you to attach images directly to posts.
[EDIT]
I have tried several other images and it worked for all images hosted akamaihd.net aka Facebook hosting. Just grab the secod number and past it in chat in double brackets.
The image is always resized to 16x16px, hence the code for Goku is so long, it's actually made from tiles.

Facebook Share Dialog image doesn't show

I'm using the Facebook Share Dialog (https://developers.facebook.com/docs/reference/plugins/share-links/) and the image doesn't appear. I've checked a lot of posts here in SO an other forums but couldn't find a solution
I found this site where Share Dialog works correctly: http://election.gv.my/ (They don't use meta property="og:image")
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http%3A%2F%2Felection.gv.my%2F&p[images][0]=http%3A%2F%2Felection.gv.my%2Fassets%2Fcombined.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28
If I use its image in my code, it shows:
var sharer = "https://www.facebook.com/sharer/sharer.php?s=100&p[url]=" + shareURL + "&p[images][0]=" + "http://election.gv.my/assets/combined.jpg" + "&p[title]=" + shareTitle + "&p[summary]=" + shareExcerpt;
If I use my image in its code it doesn't:
https://www.facebook.com/sharer/sharer.php?s=100&p[url]=http://election.gv.my/&p[images][0]=http://mysite.com/app/wp-content/uploads/2013/03/poster.jpg&p[title]=Malaysia+Twitter+Popularity+Index&p[summary]=Malaysia+Twitter+Popularity+Index+for+March+31%2C+2013%3A+%40anwaribrahim+21%2C+%40NajibRazak+28
The only reason I can think of is something in the server configuration. I've checked my url (website & image) in https://developers.facebook.com/tools/debug and the results are OK, at least the same as that site
The problem in my case was image sizes generated by WordPress:
NO: 85x85, 96x54, 166x94, 170x96, 193x108, 711x400
YES: 356x200, 360x124
https://developers.facebook.com/docs/opengraph/howtos/maximizing-distribution-media-content/
og:image – This is an image associated with your media. We suggest that you use an image of at least 200x200 pixels. However, bigger is better, so if you have a 1500x1500 image that you can use, please use it. We'll downsample and crop it for for people using smaller-resolution devices but will use it on a larger device. The larger this image is, the more likely it will be used when sharing stories on Facebook. (Note: image sizes must be no more than 5MB in size.)
But this doesn't explain why size 356x200 is ok but no 711x400 wich is bigger and has the same aspect ratio
Try reducing the file size: I changed from 56 to 24 and it then loaded.
Try adding a second "&" before "p[images][0]" => "&&p[images][0]"

Get Facebook profile picture without resizing in iphone

I am using Facebook graph API to get Facebook details. But I am getting profile image as resized.
E.g.:
I tried changing _s to _n. But still am getting size of 180x134. But original image size is 260 × 194.
How can I get the original images without resizing in iphone?
Use this:
http://graph.facebook.com/[page id/profile id]/picture?type=large
If you want to get the exactly image size, you can try fql query
$fql="SELECT id, width, height, url, is_silhouette, real_width, real_height FROM profile_pic WHERE id=me() AND height=260 AND width=194";
$avt = $facebook->api(array(
'method'=>'fql.query',
'query' =>$fql,
));
$avt = & $avt[0]['url'];
I am using php, you can learn more here

Selecting photo id, small_src from a certain album

I would like to get the ids and thumbnail image sources of pictures belonging to a certain album.I have the user_photos permission and the album_id is that of the app_user.
So far, I have tried:
https://graph.facebook.com/<album_id>?fields=photo&access_token=...
^Returns too much data like comments and tags and whatnot. I'd like to avoid that.
And FQL:
SELECT pid,src_small FROM photo WHERE aid="album_id"
url:
https://graph.facebook.com/fql?q=SELECT+pid,src_small+FROM+photo+WHERE+aid=" <album_id>"&access_token=...
Gets an empty result.
I'm planning to write an ajax photo-selector to work with my app :(
According to https://developers.facebook.com/docs/reference/fql/photo/
"src_small" -> The URL to the thumbnail version of the photo being queried. The image can have a maximum width of 75px and a maximum height of 225px. This URL may be blank.
Maybe you can try "images" instead.
For example,
SELECT pid,images FROM photo WHERE aid="album_id"
Then select one url by size range of the photo you need.

Facebook app request dialog height extends well past canvas content height in mobile Safari

We are using the following code to generate a Facebook app request dialog in our Facebook canvas app.
var options = {
method : 'apprequests',
message : 'MESSAGE',
title : 'TITLE'};
FB.ui(options, function() {alert("called back");});
When we make this call in mobile Safari on an iPad, the height of the app request dialog extends well beyond the height of the canvas, so that the user scrolls down to see a very long dialog on top of a blank background toward the bottom of the page.
Please note that this does not occur in the Facebook iPad app itself, only when accessing facebook.com through mobile Safari.
I've tried calling FB.ui with the 'touch' option - doesn't help.
I've tried calling FB.ui with the 'iframe' option and an access_token - I get a 191 error which I haven't been able to figure out how to fix.
I've made various attempts to set styles for the DOM elements that I can see make up the app request, but this isn't working.
I've tried to use
FB.Canvas.setSize($('body').height())
to force the size of the canvas in the hopes that the overlaid dialog would respect it, but no such luck.
The other approach I've considered is attempting to manipulate some of these DOM elements in the app request dialog, but this is not looking promising.
Height setting on this canvas app. is "Settable". Changing it to "Fluid" doesn't help.
Any help is appreciated.
Wes
Update - 12/19/11: The following bug is now being worked on by Facebook: https://developers.facebook.com/bugs/255079837889099