2017 © Pedro Peláez
 

library genius-php

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

image

simivar/genius-php

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

  • Wednesday, September 13, 2017
  • by simivar
  • Repository
  • 2 Watchers
  • 8 Stars
  • 16,746 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 7 Versions
  • 19 % Grown

The README.md

Genius PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. It supports oAuth 2 from version 1.0., (*1)

Getting started

Genius PHP is avialable via Composer. Version 1.0 does not implement HTTP Client on it's own anymore and uses HTTPlug abstraction so you are free to choose any HTTP Client you want that depends on php-http/client-implementation virutal package., (*2)

composer require simivar/genius-php php-http/message php-http/guzzle6-adapter

Static Bearer example

<?php

require_once('vendor/autoload.php');

$authentication = new \Http\Message\Authentication\Bearer('YOUR_ACCESS_TOKEN');

$genius = new \Genius\Genius($authentication);
$upvoteAnnotation = $genius->getAnnotationsResource()->get(11852248);

OAuth2 Example

require_once('vendor/autoload.php');

$authentication = new \Genius\Authentication\OAuth2(
  'YOUR_CLIENT_ID',
  'YOUR_CLIENT_SECRET',
  'YOUR_REDIRECT_URL',
  new \Genius\Authentication\ScopeList([
      \Genius\Enum\Scope::ME(),
      \Genius\Enum\Scope::CREATE_ANNOTATION(),
      \Genius\Enum\Scope::MANAGE_ANNOTATION(),
      \Genius\Enum\Scope::VOTE(),
  ]),
  null
);

$accessTokenFromDatabase = 'get access token from DataBase here';
if ($accessTokenFromDatabase === null) {
    $authorizeUrl = $authentication->getAuthorizeUrl();
    // redirect user to $authorizeUrl
} else {
    $authentication->setAccessToken($accessTokenFromDatabase);
}

$genius = new \Genius\Genius($authentication);
$upvoteAnnotation = $genius->getAnnotationsResource()->get(11852248);

Complete documentation, installation instructions, and examples are available at: http://simivar.github.io/Genius-PHP/., (*3)

Versioning

Genius PHP is created using Semver. All minor and patch updates are backwards compatibile. 0.1 branch is no longer maintained., (*4)

License

Please see the license file for more information., (*5)

The Versions

13/09 2017

dev-master

9999999-dev https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

  Sources   Download

MIT

The Requires

 

The Development Requires

api psr-4 httplug genius rapgenius

13/09 2017

1.0.1

1.0.1.0 https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

  Sources   Download

MIT

The Requires

 

The Development Requires

api psr-4 httplug genius rapgenius

11/07 2017

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

  Sources   Download

MIT

The Requires

 

The Development Requires

api psr-4 httplug genius rapgenius

11/07 2017

1.0.0

1.0.0.0 https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

  Sources   Download

MIT

The Requires

 

The Development Requires

api psr-4 httplug genius rapgenius

11/07 2017

dev-dev

dev-dev https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Supports every resource.

  Sources   Download

MIT

The Requires

 

The Development Requires

api psr-4 httplug genius rapgenius

20/11 2016

0.1.x-dev

0.1.9999999.9999999-dev https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Right now it supports only access_token connection (only get methods).

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

api psr-4 genius rapgenius

10/04 2016

0.1.0

0.1.0.0 https://github.com/simivar/Genius-PHP

Genius PHP is a open source library that allows you to access Genius API from your PHP application. Right now it supports only access_token connection (only get methods).

  Sources   Download

MIT

The Requires

  • php >=5.3.0
  • ext-curl *

 

api psr-4 genius rapgenius