1.1.0 • Published 11 months ago

afad-scraper v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

afad-scraper

Scraper for last earthquakes from afad.gov.tr

Usage

import AfadScraper from "afad-scaper";

const scraper = new AfadScraper();

const getEarthquakes = async () => {
  const res = await scraper.getEarthquakes();
  console.log(res); // Result on line: 17
};

Response

[
  {
    "ID": "558177",
    "Date": "2023/03/04 16:37:08",
    "Latitude": 37.128,
    "Longitude": 36.572,
    "Depth": 14.76,
    "Magnitude": 2,
    "Region": { "City": "Osmaniye", "District": "Hasanbeyli " },
    "Type": "ML"
  },
  {
    "ID": "558175",
    "Date": "2023/03/04 16:33:42",
    "Latitude": 36.067,
    "Longitude": 35.987,
    "Depth": 5.55,
    "Magnitude": 2.7,
    "Region": { "City": "Hatay", "District": "Samandağ " },
    "Type": "ML"
  }
]

Interface

interface EarthquakeInterface {
  ID: string;
  Date: Date;
  Latitude: number; // Float
  Longitude: number; // Float
  Depth: number; // Float
  Magnitude: number; // Float
  Region: { City: string; District: string };
  Type: string;
}