elbojoloco/runescape-hiscores
Composer 安装命令:
composer require elbojoloco/runescape-hiscores
包简介
An easy-to-use wrapper for communicating with both the OSRS and RS3 hiscores.
README 文档
README
Requirements
- PHP 7.1 or up
Installation
composer require elbojoloco/runescape-hiscores
Basic usage
It's very easy to start getting data from the RS3 / OSRS hiscores. All you need to get all stats for a player is this line: (Make sure to use Elbojoloco\RunescapeHiscores\Runescape;)
- OSRS:
$player = Runescape::oldschool('Lynx Titan'); - RS3:
$player = Runescape::rs3('le me');
To dynamically pass a hiscore to use you should use the get($type, $rsn) method instead:
$hiscoreType = $_GET['hiscore_type'];
$rsn = $_GET['rsn'];
$player = Runescape::get($hiscoreType, $rsn);
$type will only accept the values rs3 or oldschool, case-insensitive. The $rsn also must be at least 1 character, to prevent meaningless API calls.
You may also use the predefined constants on the Elbojoloco\RunescapeHiscores\RunescapeClient class:
Runescape::get(RunescapeClient::TYPE_OLDSCHOOL, 'Lynx Titan');
Runescape::get(RunescapeClient::TYPE_RS3, 'le me');
The Player object
All 3 of the static methods rs3(), oldschool() and get() will return an instance of Elbojoloco\RunescapeHiscores\Player.
This Player class provides some handy methods to interact with the hiscores data as show in these examples:
Retrieving the RSN
$player->name()
Retrieving the level of a skill, or multiple skills
$player->level('Runecrafting')// Returns level as a string$player->level(['Runecrafting', 'Mining', 'Construction'])// Returns an associative array of "skill" => "level"
Retrieving the experience of a skill, or multiple skills
$player->experience('Overall')// Returns experience as a string$player->experience(['Runecrafting', 'Mining', 'Construction'])// Returns an associative array of "skill" => "experience"
Retrieving the rank for a skill, boss or minigame
$player->rank('Runecrafting')// Returns rank as a string$player->rank(['Runecrafting', 'Zulrah', 'Construction'])// Returns an associative array of "stat" => "rank"
Retrieving all metrics of a skill, boss or minigame
$player->stats('Overall')// Returns a skill entry that contains "rank", "level" and "experience"$player->stats('Zulrah')// Returns a boss/minigame entry that contains "rank" and "count"$player->stats(['Hitpoints', 'Strength'])// Returns an array of skill entries$player->miniGames(['Clue scrolls (beginner)', 'Vorkath'])// Returns an array of bosses/minigames. For a full list of accepted keys please refer to RunescapeClient.php.$player->bosses()is an alias for$player->miniGames()$player->stats()// Returns an array of all stat entries
Contributing
Pull requests
Fork the repository and submit a pull request to the "master" branch. Please make sure to follow coding conventions displayed in the existing source.
Issues
Try to describe the issue in as much detail as possible and provide examples. General feedback is welcomed and much appreciated too :)
elbojoloco/runescape-hiscores 适用场景与选型建议
elbojoloco/runescape-hiscores 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 211 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 04 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「runescape」 「rs3」 「highscores」 「osrs」 「hiscores」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 elbojoloco/runescape-hiscores 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 elbojoloco/runescape-hiscores 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 elbojoloco/runescape-hiscores 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Interacts with the official OSRS API
Retrieve Hiscore results easily from the OSRS RuneScape Hiscores page.
A set of classes to better manipulate the RuneScape lite highscores API
Runescape stats forum signatures
统计信息
- 总下载量: 211
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-04-20