最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

url - Updating facebook status with message from a Javascript variable - Stack Overflow

programmeradmin2浏览0评论

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=".php?u=www.fthisclass/jshoregen.html&t=title">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!

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&t=title">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!

Share Improve this question edited Jan 9, 2010 at 6:51 asked Jan 8, 2010 at 21:32 user246748user246748
Add a comment  | 

6 Answers 6

Reset to default 22

Try this:

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

[EDIT] Link is not working please update it.

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.

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/

Using just mcqwerty solution you'll get an annoying resize screen effect.

But, you can add a parameter in order to avoid this flickering. Display touch will avoid this.

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

Here is working example which requires application ID, but fully working and it 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>

see more here

here is the way which works and it doesn't requires facebook application 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 above code you can enter custom title, summary, link and images.

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

p[url]='+ document.URL +'&amp;p[images]
发布评论

评论列表(0)

  1. 暂无评论