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.
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
Facebook has now fixed this bug. Set picture to empty string or set picture=NULL, both should work now.
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!
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!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With