2017 © Pedro Peláez
 

library php-youthweb-api

Youthweb API client

image

youthweb/php-youthweb-api

Youthweb API client

  • Thursday, January 25, 2018
  • by Art4
  • Repository
  • 7 Watchers
  • 3 Stars
  • 21 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 4 Open issues
  • 7 Versions
  • 5 % Grown

The README.md

PHP Youthweb API

Latest Version Software License GPLv3 Build Status Coverage Status Gitter, (*1)

PHP Youthweb API ist ein objektorientierter Wrapper in PHP 5.6+ für die Youthweb API., (*2)

Installation

Composer:, (*3)

$ composer require youthweb/php-youthweb-api

Dokumentation / Anwendung

<?php

error_reporting(E_ALL);
ini_set('display_errors', 1);

// Config
$client_id = 'CB91ZullPa4ync4l';
$client_secret = 'YC7CXuDXX9pF5SeTKs9enkoPjbV01QIs';
$redirect_url = 'http://localhost/php-youthweb-api/login-button.php';
$scope = ['user:read']; // See http://developer.youthweb.net/api_general_scopes.html

require 'vendor/autoload.php';

$client = new Youthweb\Api\Client([
    'api_version'   => '0.18',
    'client_id'     => $client_id,
    'client_secret' => $client_secret,
    'redirect_url'  => $redirect_url,
    'scope'         => $scope,
]);

echo '

Mit Youthweb einloggen

'; echo '
'; if ( isset($_GET['go']) ) { if ( ! $client->isAuthorized() ) { header('Location: '.$client->getAuthorizationUrl()); exit; } $me = $client->getResource('users')->showMe(); printf('<p>Hallo %s %s!</p>', $me->get('data.attributes.first_name'), $me->get('data.attributes.last_name')); printf('<p>Deine Email-Adresse: %s', $me->get('data.attributes.email')); } elseif ( isset($_GET['code']) ) { $client->authorize('authorization_code', [ 'code' => $_GET['code'], 'state' => $_GET['state'], ]); header('Location: '.$redirect_url.'?go=Login'); exit; }

Weitere Informationen zur Anwendung gibt es in der Dokumentation., (*4)

Tests

phpunit

Changelog

Der Changelog ist hier zu finden und folgt den Empfehlungen von keepachangelog.com., (*5)

Todo

  • Erstellen von Posts auf Endpoint /{object}/{object_id}/posts
  • Zugriff auf /events Resourcen
  • Zugriff auf /friends Resourcen
  • Zugriff auf /{object}/{id}/friends Resourcen
  • Request Error Handling

The Versions

25/01 2018

dev-release-0.5

dev-release-0.5 https://github.com/youthweb/php-youthweb-api

Youthweb API client

  Sources   Download

GPL3 GPL-3.0-or-later

The Requires

 

The Development Requires

api youthweb

25/01 2018
20/11 2015
21/06 2015

0.2

0.2.0.0 https://github.com/youthweb/php-youthweb-api

Youthweb API client

  Sources   Download

GPL2

The Requires

 

The Development Requires

api youthweb

20/04 2015

0.1

0.1.0.0 https://github.com/youthweb/php-youthweb-api

Youthweb API client

  Sources   Download

GPL2

The Requires

 

The Development Requires

api youthweb