views:

328

answers:

1

I've got some code right now that reliably produces the json I need formatted just the way I like it for my facebook app's streamPublish FBJS call. Now I'm playing with facebook.connect and I would like to just reuse the same json . I noticed the XFBML tag:

<fb:share-button>

while exploring facebook.connect, and thought that this would be great to use. However I noticed that it takes a bunch of meta tags ie from here

<meta name="medium" content="blog"/> 
<meta name="title" content="Leonidas in All of Us"/> 
<meta name="video_type" content="application/x-shockwave-flash"/> 
<meta name="video_height" content="345"/> <meta name="video_width" content="473"/>    
<meta name="description" content="That's the lesson 300 teaches us."/>

This looks like it could be a superset of (or the same data as) the json I could pass to the facebook(.connect).streamPublish. Would there be any way to either

  1. insert the json into this html somehow, like at "attachment" attribute or something?
  2. magically convert the json to this meta format?

Or should I just create a little link and have on onclick() event handler that calls streamPublish?

+1  A: 

The Facebook share button is neither a superset nor subset of the stream.publish method. This is frustrating, because what we all REALLY want is a union of the two. But here are the pros and cons:

Share button

  • Now renders the number of shares, like a Digg button
  • Adds a framebar to the page
  • Requires you to embed meta tags in your page

Stream.Publish

  • Does NOT render the number of shares, you would need to do that programmatically.
  • Does not add a framebar
  • Allows much more fine-grained control of the feed story

Hope this helps.

Portman
yes wow very helpful. thank you. it seems the facebook apis can be mutually inconsistent :)
Doug T.
@Doug: Yeah, it's almost as if they go out of their way to be confusing!
Portman