aksoyih/earthquakes 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aksoyih/earthquakes

最新稳定版本:1.0.3

Composer 安装命令:

composer require aksoyih/earthquakes

包简介

Combines data from Kandilli, AFAD and USGS

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License PHP Version Require

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!

License

统计信息

  • 总下载量: 2
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-02-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固