aksoyih/earthquakes
最新稳定版本:1.0.3
Composer 安装命令:
composer require aksoyih/earthquakes
包简介
Combines data from Kandilli, AFAD and USGS
README 文档
README
Features
This package makes the latest earthquake data available in an uniform format from Kandilli, AFAD and USGS sources.
Installation
The preferred way to install this extension is through composer.
Either run
composer require aksoyih/earthquakes
or add
"{package}": "aksoyih/earthquakes"
to the require section of your composer.json file.
Usage/Examples
Firstly, require the autoloader from Composer
<?php require_once "vendor/autoload.php";
Use Aksoyih\Earthquakes\Earthquakes() to create and initialize a Earthquakes instance.
$earthquakes = new Aksoyih\Earthquakes\Earthquakes();
This package can be used to either fetch the latest earthquake data from above mentioned sources, or fetch them by a given source. To fetch earthquakes data from all sources, you can use the the following example.
$earthquakeData = $earthquakes->getEarthquakesFromAllSources();
To fetch earthquakes from one source, you can use the following example.
$earthquakeData = $earthquakes->getEarthquakesFromSource('AFAD');
Example Data
[
{
"timestamp": 1676822306,
"date": "2023-02-19",
"time": "15:58:26",
"latitude": "38.173",
"longitude": "38.104",
"depth": "7.0",
"magnitude": {
"ml": "2.0",
"mw": null,
"mb": null
},
"region": "Yeşilyurt (Malatya)",
"solution_type": null,
"additional_info": {
"afad_earthquake_id": "550252"
}
},
{
"timestamp": 1676822040,
"date": "2023-02-19",
"time": "15:54:00",
"latitude": "38.503",
"longitude": "40.268",
"depth": "7.0",
"magnitude": {
"ml": "1.5",
"mw": null,
"mb": null
},
"region": "Genç (Bingöl)",
"solution_type": null,
"additional_info": {
"afad_earthquake_id": "550253"
}
}
]
TODO List
- Add sorting options
- Group earthquakes based on location, date and likelihood of being a single earthquake
- Add more sources
- Save data to some kind of database
- Add tests
Contributing
Contributions are always welcome!
统计信息
- 总下载量: 2
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-02-19