0

I'm using the facebook open graph api to post to a facebook fan page. More info on the method can be found in the answer here.

When one manually posts on facebook they can use @ to link a particular person e.g. @Michael Jackson. This auto populates a link to that persons page and shows up on their timeline. The @ itself dissapears once the post has been made, leaving only the hyperlinked text i.e. Michael Jackson.

Programatically compiling a post via the api, including the @, results in the text being posted in plain text. i.e. @Michael Jackson shows as @Michael Jackson.

How can I escape, or otherwise parse the anchor through the api so that Facebook recognises it as a link to another user/page?

Edit: I found this reference which describes these links as Actions, specifically in this case a 'Mentioning friends' action. It goes on to explain the syntax of @[USERID] or @[USERNAME] which is promising. But if I compile this encoded it posts the plain encoded text e.g. %40%5BUSERID%5D, when left un-encoded the post fails.

Community
  • 1
  • 1
square_eyes
  • 1,269
  • 3
  • 22
  • 52

1 Answers1

0

I've found that starting your message with a mention tag (i.e. @[12345678:User Name] ) throws a CurlException error.

To fix this I changed:

    'message' => '@[1234567890:User Name]';

To

    'message' => ' @[1234567890:User Name]';

Simply adding a space before the mention seems to fix that problem.

MrDevinB
  • 43
  • 1
  • 4