vestervang/rs-api
Composer 安装命令:
composer require vestervang/rs-api
包简介
An api to create a interface to all Runescape api's
README 文档
README
Core code is from Burthorpe's runescape-api
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:
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:
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.
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.
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).
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.
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.
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.
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.
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.
Area
This function is case-sensetive 'The Abyss' and 'The abyss' will not return the same results.
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.
vestervang/rs-api 适用场景与选型建议
vestervang/rs-api 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 16 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 04 月 14 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「package」 「template」 「composer」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vestervang/rs-api 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vestervang/rs-api 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vestervang/rs-api 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
This composer plugin enables installation of GravityForms WordPress plugin and its addons.
Simple ASCII output of array data
E2E Studios PHP Framework adaptation of leafsphp/blade package
Generate a Composer repository from installed WordPress plugins and themes.
统计信息
- 总下载量: 16
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-04-14