views:

1381

answers:

3

Hey all, quick question.

Is there an easy way to let users update their status on Facebook with a message I have in a JavaScript variable? I know there's a URL you can use to share a link, which looks like:

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

That doesn't fill in a status update when it takes them to the share page. Is there a way I can have that pre-filled, or have their status automatically updated?

Thanks!

Edit: Not quite what I'm going for. I can use PHP if necessary (although I have very little experience with it), but I don't want to have to bug users with allowing an application, or have to deal with actually writing a facebook app. I just want to give users a premade status update, so all they have to do is click the 'share' button. Thanks again!

Edit 2: So the api looks promising, but a little complicated for me. It looks like it would involve getting permission from the user to set their status, and possibly something about setting up a cross-communications channel to let my site communicate with facebooks. Assuming I can do that, how do I go about using the Facebook Javascript api? I get the code (user_setStatus looks easy enough), but how do I tell my script that I'm using Facebook's api? Thanks again...again!

A: 

Not sure if you're using PHP but here's a link that shows you how to use the Facebook API to update the status. You could call a page with Ajax from Javascript, passing in the variable and have that posted to the Facebook status message.

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

Shawn Steward
+1  A: 

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

users_setStatus(...) looks promising.

Kevin Montrose
So the api looks promising, but a little complicated for me. It looks like it would involve getting permission from the user to set their status, and possibly something about setting up a cross-communications channel to let my site communicate with facebooks. Assuming I can do that, how do I go about using the Facebook Javascript api? I get the code (user_setStatus looks easy enough), but how do I tell my script that I'm using Facebook's api? Thanks again...again!
Dan
Kevin Montrose
+9  A: 

Try this:

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

mcqwerty
I wish I could upvote twice
MedicineMan
i just helped you upvote it the second time.. now i wish i had upvoted it for myself..
royston