2017 © Pedro Peláez
 

library hackerrank-api

PHP and Laravel HackerRank Code Checker API

image

shipu/hackerrank-api

PHP and Laravel HackerRank Code Checker API

  • Wednesday, March 28, 2018
  • by shipu
  • Repository
  • 1 Watchers
  • 11 Stars
  • 18 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 5 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

HackerRank API

Latest Stable Version Latest Unstable Version License, (*1)

HackerRank Code Checker API. Extremely simple REST API. Supports more than a dozen languages. All powered by reliable HackerRank servers. You can use your own scoring system or build your own online judge., (*2)

40+ programming languages support., (*3)

Installation

Themevel is a Laravel package so you can install it via Composer. Run this command in your terminal from your project directory:, (*4)

composer require shipu/hackerrank-api

Wait for a while, Composer will automatically install Themevel in your project., (*5)

Laravel Configuration

When the download is complete, you have to call this package service in config/app.php config file. To do that, add this line in app.php in providers array:, (*6)

Shipu\HackerRank\HackerRankServiceProvider::class,

To use facade you have to add this line in app.php to the aliases array:, (*7)

'HackerRank' => Shipu\HackerRank\Facades\HackerRank::class,

Now run this command in your terminal to publish this package resources:, (*8)

php artisan vendor:publish --provider="Shipu\HackerRank\HackerRankServiceProvider"

after publishing your config file then open config/hackerrank.php and add your hackerrank app key:, (*9)

return [
    /*
    |--------------------------------------------------------------------------
    | HackerRank API KEY
    |--------------------------------------------------------------------------
    |
    | https://www.hackerrank.com/api/
    |
    */

    'api_key' => env('HACKERRANK_API_KEY', 'YOUR_HACKER_RANK_API_KEY'),
];

also you can add api key in .env :, (*10)

 HACKERRANK_API_KEY = YOUR_HACKER_RANK_API_KEY

Thats it., (*11)

API List

  • languages()
  • submission($lang, $source, $testcases = [ "1" ], $format = 'json', $wait = true, $callback_url = '')

Usages

```php use Shipu\HackerRank\HackerRank;, (*12)

$config = [ "api_key" => 'hackerrank_app_key', ];, (*13)

$hackerRank = new HackerRank($config);, (*14)

$allLanguages = $hackerRank->checker()->languages();, (*15)

var_dump($allLanguages->data); ```, (*16)

For Laravel Usage

```php use Shipu\HackerRank\Facades\HackerRank; //.. //.. $allLanguages = HackerRank::checker()->languages();, (*17)

dd($allLanguages->data); ```, (*18)

### Code Submission, (*19)

```php use Shipu\HackerRank\Facades\HackerRank; //.. //.. $response = HackerRank::checker()->submission('php', '');, (*20)

dd($response->data); ```, (*21)

### Code Submission with TestCase, (*22)

```php use Shipu\HackerRank\Facades\HackerRank; //.. //.. // Problem is returns the sum of two integers. // Problem link: https://www.hackerrank.com/challenges/solve-me-first // Submit code with two tescase example., (*23)

$response = HackerRank::checker()->submission('php', '', ["1\n2", "2\n3"]);, (*24)

// output array respectively as test cases dd($response->data->result->stdout); ```, (*25)

Support on Beerpay

Hey dude! Help me out for a couple of :beers:!, (*26)

Beerpay Beerpay, (*27)

The Versions

28/03 2018

dev-master

9999999-dev http://shipuahamed.com

PHP and Laravel HackerRank Code Checker API

  Sources   Download

MIT CC(1.0)

The Requires

 

The Development Requires

laravel code online checker judge hackerrank

28/03 2018

v1.1

1.1.0.0 http://shipuahamed.com

PHP and Laravel HackerRank Code Checker API

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel code online checker judge hackerrank

31/05 2017

v1.0

1.0.0.0 http://shipuahamed.com

PHP and Laravel HackerRank Code Checker API

  Sources   Download

CC(1.0)

The Requires

 

The Development Requires

laravel code online checker judge hackerrank