Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I post a Link to Facebook without a thumbnail?

I'd like to post a Link to Facebook using the Graph API, but I'd like to be able to avoid a thumbnail image. Facebook's web interface has a no-thumbail checkbox while posting an image; I'd like to simulate this from my own application.

I've tried specifying an empty string for both the source and picture arguments, but Facebook still fetches a thumbnail image for the specified link regardless.

For example, I've tried this, but a thumbnail image still shows up:

curl -F 'access_token=...' \
     -F 'message=Link with empty source and empty picture' \
     -F 'link=http://stackoverflow.com' \
     -F 'picture=' \
     -F 'source=' \
     https://graph.facebook.com/me/feed

UPDATE: This support forum suggests that this is a bug with Facebook, and they suggest posting a 1x1 pixel clear image. I'd prefer a better workaround than this.

like image 809
Ryan McGeary Avatar asked Nov 22 '10 14:11

Ryan McGeary


4 Answers

Since picture=0 no longer seems to work without throwing an error, here's another way, but it's a hack and not likely recommended. By skipping the picture argument and specifying a source argument that is a valid URL, but isn't an image, Facebook will render the post without the thumbnail. For example:

curl -F 'access_token=...' \
     -F 'message=Link with empty source and empty picture' \
     -F 'link=http://cnn.com' \
     -F 'source=http://cnn.com' \
     https://graph.facebook.com/me/feed
like image 76
Ryan McGeary Avatar answered Oct 26 '22 16:10

Ryan McGeary


Facebook has now fixed this bug. Set picture to empty string or set picture=NULL, both should work now.

like image 21
Master Drools Avatar answered Oct 26 '22 16:10

Master Drools


I talked with Facebook developers at F8 2011 and they agreed that this is a bug. I have filed this bug with Facebook in their new bug tracking system:

https://developers.facebook.com/bugs/231434760243248

If you want it fixed, upvote this question & answer!

like image 42
Akrikos Avatar answered Oct 26 '22 15:10

Akrikos


Try using the value "0" for picture. This worked for us, it does show a gray bar next to the link information, but it doesn't pull in a default image and doesn't display the awkward whitespace when using a 1x1 pixel.

Hope this helps!

like image 29
Andy Muth Avatar answered Oct 26 '22 15:10

Andy Muth