From 579a03f91c0090a6347c9fd127115c67cd72556e Mon Sep 17 00:00:00 2001 From: Eric Khun Date: Mon, 29 Jun 2015 11:43:19 +0200 Subject: [PATCH 1/2] Add image and link example Thank you for making this library available! I just add few examples to make it easier for our users to use your lib. Great works Kevin on this! --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 8fcc818..d361f46 100644 --- a/README.md +++ b/README.md @@ -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 'Connect to Buffer!'; } else { @@ -62,6 +63,28 @@ 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[picture]'=> $url_image, + 'media[thumbnail]'=> $url_thumbnail, + '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. From ee322a34e7ec9d7d8a735786590ca9f4a24d8d9b Mon Sep 17 00:00:00 2001 From: Eric Khun Date: Mon, 29 Jun 2015 12:01:55 +0200 Subject: [PATCH 2/2] remove picture/thumbnail in update link example --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index d361f46..359812b 100644 --- a/README.md +++ b/README.md @@ -67,8 +67,6 @@ Now that we've received access we are free to run queries against Buffer endpoin $buffer->go('/updates/create', array( 'text' => 'My first status update with a link worked!', - 'media[picture]'=> $url_image, - 'media[thumbnail]'=> $url_thumbnail, 'media[link]'=> $link, 'media[description]'=> 'your description', 'profile_ids[]' => $profile->id,