codedefective/quake-turkey

1.0.0 2019-09-28 18:38 UTC

This package is auto-updated.

Last update: 2024-09-29 05:28:47 UTC


README

"QuakeTurkey" 可让您追踪土耳其的最新地震并筛选数据。

  • 数据收集自 博斯普鲁斯大学康迪利天文台和地震研究所

  • 您可以列出最多500条数据。

  • 您可以设置数据限制。

  • 您可以按日期和位置分组数据。

  • 您可以调整日期、位置和大小以调整数据。

安装 QuakeTurkey

推荐通过 Composer 安装 QuakeTurkey。

# Install Composer
curl -sS https://getcomposer.org/installer | php

接下来,运行 Composer 命令安装 QuakeTurkey 的最新稳定版本

php composer.phar require codedefective/quakeTurkey

安装后,您需要引入 Composer 的自动加载器

require 'vendor/autoload.php';

然后您可以使用 composer 更新 QuakeTurkey

php composer.phar update

Quake Turkey 使用方法

require 'vendor/autoload.php';

//if you're working with the clone you should add this
require 'inc.php';
use codedefective\quakeTurkey;

$quakes = new quakeTurkey();

//All data (max 500)
$quakes->getList();

//Limited data (ex:15)
$quakes->limit(15);

//To group by location;
$quakes->groupByLocation()->getList();
//json response;
$quakes->groupByLocation()->toJson()->getList();

//To group by date;
$quakes->groupByDate()->getList();
//json response;
$quakes->groupByDate()->toJson()->getList();

//To sort by date;
$quakes->sortByDate()->getList();
//json response;
$quakes->sortByDate()->toJson()->getList();

//To sort by location;
$quakes->sortByLocation()->getList();
//json response;
$quakes->sortByLocation()->toJson()->getList();

//To sort by size;
$type = 'ml'; // default type ml (ml, md,mw)
$quakes->sortBySize($type)->getList();
//json response;
$quakes->sortBySize()->toJson()->getList();

//graph (experimental)
$quakes->limit(6)->createGraphic();