views:

362

answers:

1

I'm using the Facebooker plugin in Rails to publish a user action to their newsfeed, but the image isn't being added.

The call (via Net::HTTP.post_form) looks like this:

Posting to http://api.facebook.com/restserver.php with
{:api_key=>"4f5ed28f76142adsfasdf029c98ad", :template_bundle_id=>"107345673712", 
:template_data=>"{\"project\": \"testing\", \"images\": 
[{\"src\":\"http://www.dezyne.net/news.jpg\", 
\"href\":\"http://www.facebook.com/\"}]}", 
:session_key=>"2.nvhdfsdfgimDZWSwQ__.86400.1245405600-100000007614297", 
:method=>"facebook.feed.publishUserAction", :sig=>"ac0a7181b351b5fdgsdfge767a004314", 
:call_id=>"1242343866.44512", :v=>"1.0"}

'Project' is captured OK in the text that's posted to the newsfeed.

A: 

One possible issue is that you tested this template before actually uploading the image. This would cause Facebook to have cached an empty image. Every time the image is requested, FB uses their stored cache rather than retrieving the image all over again.

If this is the problem, the solution is to use the API function fbml.refreshImgSrc() to cause Facebook to update their cache. Unfortunately there's no quick mechanism to do this as that API method is not available in the Test Console nor through the Developer app at all, meaning you will need to write a script just to refresh the cache of this image.

If this doesn't help, post back and I'll see if I can't think of any other possible problems.

Dustin Fineout
These are all good ideas, but it turns out that it's much simpler.I was posting a "one-line" (default) newsfeed item. These do have pictures (16x16), _but it's your app's default picture_, not the one you pass to the newsfeed. And I hadn't set up an app default picture.D'oh.
Gwyn Morfey
Haha oh. I didn't even consider that could be what you meant. I'm so hardwired to only think of that as an icon it didn't occur me :-p
Dustin Fineout