2017 © Pedro Peláez
 

library rs-api

An api to create a interface to all Runescape api's

image

vestervang/rs-api

An api to create a interface to all Runescape api's

  • Saturday, April 14, 2018
  • by vestervang
  • Repository
  • 1 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

RS-api

Build Status Latest Stable Version Latest Unstable Version Total Downloads License, (*1)

Core code is from Burthorpe's runescape-api, (*2)

Installation

Dependencies

Installation

composer require vestervang/rs-api

Usage

Hiscore

require __DIR__.'/vendor/autoload.php';

use vestervang\rsApi\RS3\Hiscore;

$hiscore = new Hiscore();
$username = 'zezima';
$stats = $hiscore->getStats($username)

If you want to loop through the list of stats you can do it like this:, (*3)

for($i = 0; $i < $stats->getCount(); $i++){

    $stat = $stats->getStat($i);

    echo 'Name: '. $stat->getSkill()->getName(). '<br>';
    echo 'Rank: '. $stat->getRank(). '<br>';
    echo 'Level: '. $stat->getLevel(). '<br>';
    echo 'Xp: '. $stat->getExperience(). '<br>';
    echo '<br><br>';
}

Or if you want to use a foreach:, (*4)

foreach($stats->getStats() as $stat){

    echo 'Name: '. $stat->getSkill()->getName(). '<br>';
    echo 'Rank: '. $stat->getRank(). '<br>';
    echo 'Level: '. $stat->getLevel(). '<br>';
    echo 'Xp: '. $stat->getExperience(). '<br>';
    echo '<br><br>';

}

GE

The only way to get a item price at the moment is by finding the id and using that., (*5)

require __DIR__.'/vendor/autoload.php';

use vestervang\rsApi\RS3\GE;

$api = new GE();
$item = $api->getItemById(4151);

I calculate the percent difference myself to get a more accurate number instead of the +0.0% og -0.0% the api returns., (*6)

Bestiary

In the bestiary api there is a option to save the result of an api call to a repo (The result will be saved to the repo as a Beast object)., (*7)

This can be turned off on a per call basis. Just send false as a second parameter and it won't save the data in the repo., (*8)

Id

require __DIR__.'/vendor/autoload.php';

$bestiary = new \vestervang\rsApi\RS3\Bestiary();

//This will save to the repo and returns the json
$beast = $bestiary->getBeastById(49);

//This call only returns the json
$beast = $bestiary->getBeastById(49, false);

This will return the json for a monster with all details., (*9)

Name

require __DIR__.'/vendor/autoload.php';

$bestiary = new \vestervang\rsApi\RS3\Bestiary();

$beast = $bestiary->getBeastByName('cow');

This will return the json for a list of beasts with names and ids., (*10)

Level

require __DIR__.'/vendor/autoload.php';

$bestiary = new \vestervang\rsApi\RS3\Bestiary();

$beast = $bestiary->getBeastsByLevel('150-300');

This will return the json for a list of beasts with names and ids., (*11)

Letter

require __DIR__.'/vendor/autoload.php';

$bestiary = new \vestervang\rsApi\RS3\Bestiary();

$beast = $bestiary->getBeastsByLetter('y');

This will return the json for a list of beasts with names and ids., (*12)

Area

This function is case-sensetive 'The Abyss' and 'The abyss' will not return the same results., (*13)

require __DIR__.'/vendor/autoload.php';

$bestiary = new \vestervang\rsApi\RS3\Bestiary();

$beast = $bestiary->getBeastsByArea('The Abyss');

This will return the json for a list of beasts with names and ids., (*14)

The Versions

14/04 2018

dev-master

9999999-dev

An api to create a interface to all Runescape api's

  Sources   Download

MIT

The Requires

 

The Development Requires

by Frederik Thomsen

template composer package

12/04 2018

v1.0.5

1.0.5.0

An api to create a interface to all Runescape api's

  Sources   Download

MIT

The Requires

 

The Development Requires

by Frederik Thomsen

template composer package

02/04 2018

v1.0

1.0.0.0

An api to create a interface to all Runescape api's

  Sources   Download

MIT

The Requires

 

The Development Requires

by Frederik Thomsen

template composer package