dsyph3r / github-api3-php Goto Github PK
View Code? Open in Web Editor NEWPHP library for the GitHub API v3
License: MIT License
PHP library for the GitHub API v3
License: MIT License
When I try to login the script throw no errors,
but I am obviously not logged in as
var_dump($user->emails()->all());
report unauthorized
using
$user->setCredentials(new Authentication\Basic('username', 'password'));
$user->login();
Notice: Undefined variable: username in /home/gufron/public_html/infosmenda-api/lib/GitHub/API/Repo/Commit.php on line 45
at the parameters, it is named as $usename but you use $username instead on calling the process function.
Hi there,
I'm trying to use the api, but with this basic code :
require_once dirname(__FILE__) . '/github-api3-php/lib/vendor/Symfony/Component/ClassLoader/UniversalClassLoader.php'; $loader = new Symfony\Component\ClassLoader\UniversalClassLoader(); // Register the location of the GitHub namespace $loader->registerNamespaces(array( 'Buzz' => __DIR__.'/github-api3-php/lib/vendor/Buzz/lib', 'GitHub' => __DIR__.'/github-api3-php/lib' )); $loader->register(); use GitHub\API\Authentication; use GitHub\API\User\User; use GitHub\API\AuthenticationException; use GitHub\API\User\User; // Setup the user, and authenticate (using basic HTTP auth) $user = new User(); $user->setCredentials(new Authentication\Basic('quoidautre', 'MY_PASSWORD')); $user->login(); // Get the user details $response = $user->get(); var_dump($response);
I've this error :
object(Buzz\Message\Response)[8] protected 'headers' => array (size=4) 0 => string 'HTTP/1.0 403 Forbidden' (length=22) 1 => string 'Cache-Control: no-cache' (length=23) 2 => string 'Connection: close' (length=17) 3 => string 'Content-Type: text/html' (length=23) protected 'content' => string 'Request forbidden by administrative rules. Please make sure your request has a User-Agent header (http://developer.github.com/v3/#user-agent-required). Check https://developer.github.com for other possible causes.' (length=213)
Any idea ?, can anybody helps me ?
Thanks.
Fabrice
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.