Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ If `$_GET['code']` is set on this page it assumes it came from Buffer and will a
Once we've got an `access_token` set the `$buffer->ok` property will read true. It is false by default.
Now that we've received access we are free to run queries against Buffer endpoints! Below we pull the list of profiles associated with the logged in buffer user and submit a test update to each one.

##Post an update with a simple text
if (!$buffer->ok) {
echo '<a href="' . $buffer->get_login_url() . '">Connect to Buffer!</a>';
} else {
Expand All @@ -62,6 +63,26 @@ Now that we've received access we are free to run queries against Buffer endpoin
}
}

##Post an update with a link
$buffer->go('/updates/create',
array(
'text' => 'My first status update with a link worked!',
'media[link]'=> $link,
'media[description]'=> 'your description',
'profile_ids[]' => $profile->id,
));

##Post an update with an image
$buffer->go('/updates/create',
array(
'text' => 'My first status update with an image worked!',
'media[picture]'=> $url_image,
'media[thumbnail]'=> $url_thumbnail,
'profile_ids[]' => $profile->id,
));

Please also note that you'll need the media[picture] and media[thumbnail] to make it work

# Storage

Right now this baby just stores the `access_token` in `$_SESSION['oauth']['buffer']['access_token']`. If you are doing something serious with this you should probably rewrite the `store_access_token()` and `retrieve_access_token()` methods.
Expand Down