Librería PHP para Google Buzz

La verdad es que no tengo ni idea del éxito/uso de Google Buzz, dicen que es un fracaso, pero claro, a saber lo que es un fracaso comparado con otras redes sociales (no Twitter o Facebook, claro), por lo que no está mal saber que existe una librería y que te permite trabajar con Google Buzz.


// Include the library files
require_once "google-api-php-client/src/apiClient.php";
require_once "google-api-php-client/src/contrib/apiBuzzService.php";

// Create the apiClient and Buzz service classes:
$apiClient = new apiClient();
$buzz = new apiBuzzService($apiClient);

// Add the OAuth authentication flow to your app:
// If a oauth token was stored in the session, use that- and otherwise go through the oauth dance
session_start();
if (isset($_SESSION['auth_token'])) {
  $apiClient->setAccessToken($_SESSION['auth_token']);
} else {
  // In a real application this would be stored in a database, and not in the session!
  $_SESSION['auth_token'] = $apiClient->authenticate();
}

// Make an API call
$activities = $buzz->listActivities('@consumption', '@me');

// And echo the returned activities
echo "
Activities:\n" . print_r($activities, true) . "

";

buzz-php-client

Similar Posts