Crashalot
Crashalot

Reputation: 34513

How to pre-populate the Facebook status message through an URL similar to pre-populating a tweet?

This question has been asked before on SO, but most of those questions were asked a long time ago.

Essentially, we want a simple way to pre-populate the Facebook status message through the URL much like you can with Twitter.

We're aware of the Facebook APIs, but are wondering if there is a more lightweight approach.

We don't need programmatically to post a message, but just provide some default text that the user can edit before sharing.

Upvotes: 16

Views: 30384

Answers (3)

covati
covati

Reputation: 899

That actually violates the FB TOS:

Policy Violation: Pre-fill the user message parameter with any content the user didn't enter themselves, even if they can edit or delete that content before sharing. This applies to posts, comments, photo captions, and photo album captions.

https://developers.facebook.com/docs/apps/review/prefill

Facebook doesn't want you to tell users what to say.

Upvotes: 30

Jörn Berkefeld
Jörn Berkefeld

Reputation: 2579

use the FB sharer - though it's supposed to be deprecated for a year or so it still works just fine. just add a link to a page or forward your user to this url (change the www.myDomain/path/ part):

Forward to:

http://www.facebook.com/sharer.php?src=sp&u=http%3A%2F%2Fwww.myDomain.com%2Fpath%2F

or add link like that:

<a href="http://www.facebook.com/sharer.php?src=sp&u=http%3A%2F%2Fwww.myDomain.com%2Fpath%2F">Share on FB</a>

be aware that all info that's presented for your page can be set via META tags which must be present on the page that was passed to the sharer.php. You canNOT change the title, image and description via some other variable

that's about as lightweight as it gets - hope it helps

Update: see http://davidwalsh.name/facebook-meta-tags for a good tutorial on the meta tags

Update 2014-01: the API is no longer deprecated... lol

Upvotes: 5

Vijay
Vijay

Reputation: 5433

You can use the 'Message' property in either 'Feed dialog' or 'POST' method of GRAPH API.

As you dont want to use much of code, you may use the Feed dialog and you can give the text whatever you want to populate in the 'Message' property.

But remember you need the user_access_token for the message to be displayed.

See the following links for information

https://developers.facebook.com/docs/reference/dialogs/feed/
http://developers.facebook.com/docs/reference/api/post/

Upvotes: -1

Related Questions