frhag/bmkg-earthquake
Composer 安装命令:
composer require frhag/bmkg-earthquake
包简介
A wrapper package for the BMKG earthquake open data
关键字:
README 文档
README
A PHP wrapper package for the BMKG earthquake open data.
Badan Meteorologi, Klimatologi, dan Geofisika a.k.a BMKG is the Indonesian official source of information related to weather, climate, earthquake etc.
This package gets information about earthquake that happened in Indonesia, and ease the integration to other PHP application. The data only consists of 60 latest earthquake with magnitude 5 or more.
This package and the author is not related to BMKG.
Installation
Use the package manager composer to install.
composer require frhag/bmkg-earthquake
Usage
This package only have single usable static method fetch() of Earthquake class.
$resultArray = Earthquake::fetch();
Standalone
To try the package as standalone, create a new directory, cd in to it, and perform installation via composer
mkdir myapp
cd myapp
composer require frhag/bmkg-earthquake --prefer-dist
Create a file named index.php in that directory and paste this code:
<?php
require 'vendor/autoload.php';
use Frhag\BmkgEarthquake\Earthquake;
echo json_encode(Earthquake::fetch());
Execute the file
php index.php
Output
[{
"time": "2020-08-02T16:44:24.000000Z",
"coordinates": "124.41,-0.45",
"lat": "0.45 S",
"lon": "124.41 E",
"magnitude": "5.0 Richter Scale",
"depth": "10 Km",
"area": "103 km SouthEast BOLAANGUKI-BOLSEL-SULUT"
}, {
"time": "2020-07-30T02:51:20.000000Z",
"coordinates": "131.11,-3.43",
"lat": "3.43 S",
"lon": "131.11 E",
"magnitude": "5.4 Richter Scale",
"depth": "15 Km",
"area": "77 km SouthEast SERAMBAGIANTIMUR-MALUKU"
},
...
]
With Laravel
Perform installation via composer in the Laravel project. Laravel version 5.5 and above will automatically discover the newly installed package.
To quickly try the package, add this code to Laravel route web.php file:
...
Route::get('bmkg-earthquake', function() {
return \Frhag\BmkgEarthquake\Earthquake::fetch();
});
...
Test it in browser by opening the bmkg-earthquake path.
Output
[{
"time": "2020-08-02T16:44:24.000000Z",
"coordinates": "124.41,-0.45",
"lat": "0.45 S",
"lon": "124.41 E",
"magnitude": "5.0 Richter Scale",
"depth": "10 Km",
"area": "103 km SouthEast BOLAANGUKI-BOLSEL-SULUT"
}, {
"time": "2020-07-30T02:51:20.000000Z",
"coordinates": "131.11,-3.43",
"lat": "3.43 S",
"lon": "131.11 E",
"magnitude": "5.4 Richter Scale",
"depth": "15 Km",
"area": "77 km SouthEast SERAMBAGIANTIMUR-MALUKU"
},
...
]
License
frhag/bmkg-earthquake 适用场景与选型建议
frhag/bmkg-earthquake 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 17 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 08 月 03 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「Earthquake」 「bmkg」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 frhag/bmkg-earthquake 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 frhag/bmkg-earthquake 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 frhag/bmkg-earthquake 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
PHP Library to access to FDSN webservices
A wrapper for a better USGS api.
php api client for https://data.bmkg.go.id/
Filament widget for displaying real-time weather information from BMKG (Badan Meteorologi, Klimatologi, dan Geofisika) API
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-08-03