Skip to content

Instantly share code, notes, and snippets.

@niraj-shah
Created June 12, 2014 19:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save niraj-shah/5b0cce809b75f2aa3836 to your computer and use it in GitHub Desktop.
Save niraj-shah/5b0cce809b75f2aa3836 to your computer and use it in GitHub Desktop.
Using a ID from taggable_friends to post Status Update using Graph API 2.0 and Facebook PHP SDK 4.0.x
<?php
// requires Facebook PHP SDK 4.0.x or later
// user must be logged-in prior to API call
// publish story, requires 'places' attribute
// use a page_id with no address to tag hidden location
// $tags is a comma-separated string of IDs
$story = (new FacebookRequest( $session, 'POST', '/me/feed', array(
'message' => 'test', 'tags' => $tags, 'place' => '195383960551614'
) ))->execute()->getGraphObject()->asArray();
// returns post_id
echo '<pre>' . print_r( $story, 1 ) . '</pre>';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment