PHP code example of nick-scalewest / github-reader
1. Go to this page and download the library: Download nick-scalewest/github-reader library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once ('vendor/autoload.php' );
nick-scalewest / github-reader example snippets
composer
\GithubReader\GithubReaderServiceProvider::class,
'GithubReader' => \GithubReader\Facades\GithubReader::class,
php artisan vendor:publish
'app' => [
'clientId' => 'xxx**************xxx' ,
'clientSecret' => 'xxx**************xxx' ,
'method' => 'application' ,
],
$repository = app('github-reader' )->read('rummykhan' , 'github-reader' );
dd($repository);
$repository = app('github-reader' )->read('rummykhan' , 'github-reader' );
$files = $repository->getFiles();
$file = $files->first()->retrieve();
dd($file->getContent());
$repository = app('github-reader' )
->read('rummykhan' , 'github-reader' );
$file = $repository->getFiles()->where('name' , 'LICENSE' )->first();
dd($file);
$repository = app('github-reader' )
->read('rummykhan' , 'github-reader' );
$file = $repository->whereInFiles('name' , 'LICENSE' )->first();
dd($file);
$repository = app('github-reader' )
->read('rummykhan' , 'github-reader' );
$dictionary = $repository->getDirectories()->where('name' , 'src' )->first();
dd($dictionary);
$repository = app('github-reader' )
->read('rummykhan' , 'github-reader' );
$dictionary = $repository->whereInDictionaries('name' , 'src' )->first();
dd($dictionary);
$repository = app('github-reader' )
->read('rummykhan' , 'github-reader' );
$found = $repository->find('type' , 'file' );
dd($found);
$repository = app('github-reader' )
->read('rummykhan' , 'github-reader' );
$found = $repository->find('name' , 'File.php' , true );
dd($found);
$reader = app('github-reader' )
$directory = app('github-reader' )
->setOrganization('rummykhan' )
->setRepositoryName('github-reader' )
->readPath('src' );
$repository = app('github-reader' )->read('rummykhan' ,'github-reader' );
$repository = app('github-reader' )->read('rummykhan' ,'github-reader' );
$file = $repository->getFiles()->first();
$repository = app('github-reader' )->read('rummykhan' ,'github-reader' );
$file = $repository->getFiles()->first();
$fileContent = $file->retrieve();