\O3PO_Buffer

Encapsulates the interface with the external service Buffer.com.

Provides methods to interface with Buffer.com.

Summary

Methods
Properties
Constants
create_update()
get_profile_information()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

create_update()

create_update(string  $buffer_url, string  $access_token, array|string  $profile_ids, string  $text = '', array  $media = array(), boolean  $attachment = true, boolean  $shorten = false, boolean  $now = false, boolean  $top = false, integer  $timeout = 15) : boolean|\WP_Error

Http post meta data to Buffer.

Schedule a social media update via Buffer.com's api. For more information see here https://buffer.com/developers/api/updates

Parameters

string $buffer_url

Url of the Buffer.com api.

string $access_token

Access token.

array|string $profile_ids

An array of Buffer profile id’s of an individual id that the status update should be sent to.

string $text

The status update text.

array $media

An associative array of media to be attached to the update containing some of the following parameters: link, description, title, picture, photo, thumbnail.

boolean $attachment

Whether a link in the text should automatically populate the media parameter if media is empty.

boolean $shorten

If shorten is false links within the text will not be automatically shortened, otherwise they will.

boolean $now

If now is set, this update will be sent immediately to all profiles instead of being added to the buffer.

boolean $top

If top is set, this update will be added to the top of the buffer and will become the next update sent.

integer $timeout

Maximum number of seconds to wait for a response (default 15 seconds).

Returns

boolean|\WP_Error —

Returns true on success or a WP_Error in case an error occurred.

get_profile_information()

get_profile_information(string  $buffer_api_url, string  $access_token, integer  $timeout = 2) : array|\WP_Error

Get a list of services and profiles that are accessible via a given acces token.

Parameters

string $buffer_api_url

Url of the Buffer.com api.

string $access_token

Access token.

integer $timeout

Timeout of the request in seconds (default 2 seconds)

Returns

array|\WP_Error —

An array of associative array with fields 'srevice' and 'id' containing the service names and corresponding ids.