Update facebook state with message from Javascript variable

Is there an easy way to allow users to update their status on Facebook using the message I have in a JavaScript variable? I know there is a URL that you can use to exchange a link that looks like this:

<a href="http://www.facebook.com/sharer.php?u=www.fthisclass.com/jshoregen.html&t=title">testlink </a> 

This does not populate the status update when it brings them to the sharing page. Is there a way that I can have a pre-populated or automatically update my status?

Thanks!

Edit: Not quite what I'm going to do. I can use PHP if necessary (although I have very little experience with it), but I do not want to need to bypass users using the application or to deal with writing a facebook application. I just want to give users an updated status update, so all they need to do is click the Share button. Thanks again!

Edit 2: Api looks promising, but a bit complicated for me. It seems like this will require obtaining permission from the user to establish their status, and maybe something about setting up a cross channel for my site to communicate with facebook. Assuming I can do this, how do I go with the JavaScript Javascript api? I get the code (user_setStatus looks pretty simple), but how do I tell my script that I am using the Facebook api? Thanks again ... again!

+7
javascript url facebook share status
source share
6 answers

Try the following:

http://www.facebook.com/connect/prompt_feed.php?&message=my%20awesome%20status

[EDIT] Link not working, please update it.

+22
source share

Is facebook javascript api not what you are looking for? It seems to expose the entire REST-ful API as a javascript library.

users_setStatus(...) looks promising.

+3
source share

Not sure if you are using PHP, but here is a link that shows you how to use the Facebook API to update status. You can call up an Ajax page from Javascript by passing a variable and posting it in a Facebook status message.

http://fbcookbook.ofhas.in/2009/02/07/facebook-reveals-status-api-how-to-use-it/

0
source share

Using only the mcqwerty solution, you get the effect of annoying resizing.

But you can add a parameter to avoid this flicker. Touching the screen will not allow this.

https://www.facebook.com/connect/prompt_feed.php?display=touch&message=Hiall

0
source share

Here is a working example that requires an application identifier but works completely and is easy to implement:

 <a href="http://www.facebook.com/dialog/feed?app_id=123050457758183&link=http://www.build.server.com&picture=http://fbrell.com/f8.jpg& name=Some%20Encoded&Message=Reference%20Documentation& description=Using%20Dialogs%20to%20interact%20with%20users.& redirect_uri=https://arapskirjecnik.web44.net/"> Share with FB</a> 

more details here

0
source share

Here's how it works, and it doesn't require the facebook app id:

 <a onClick="window.open('http://www.facebook.com/sharer.php?s=100&amp;p[title]=Title&amp;p[summary]=summary&amp;p[url]=www.build.server.com&amp;p[images][0]=http://fbrell.com/f8.jpg','sharer','toolbar=0,status=0,width=548,height=325');" href="javascript: void(0)">Insert text or an image here.</a> 

As you can see from the above code, you can enter a custom title, summary, link and images.

and if you want to automate to share the current link, you will replace this part of the code in the above example:

 p[url]='+ document.URL +'&amp;p[images] 
0
source share

All Articles