0.0.3 • Published 1 year ago

pxsty.earthquakes v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

pxsty.earthquakes

npm i pxsty.earthquakes

Belirli sürede bir afad'ın sayfasına erişim sorunu yaşanmaktadır bu sebepten kütüphane hata verebilir.

const pxstyEarthQuakes = require("pxsty.earthquakes");
pxstyEarthQuakes()
  .then((data) => console.log(data[0])) /*
  {
  tr: {
    tarih: '2023-02-17 15:20:56',
    enlem: '37.311',
    boylam: '37.018',
    derinlik: '15.25',
    tip: 'ML',
    buyukluk: '3.3',
    yer: 'Türkoğlu (Kahramanmaraş)'
  },
  en: {
    date: '2023-02-17 15:20:56',
    latitude: '37.311',
    longitude: '37.018',
    depth: '15.25',
    type: 'ML',
    size: '3.3',
    place: 'Türkoğlu (Kahramanmaraş)'
  },
  afadDepremID: '549276'
}*/
  .catch(() => console.log("Hata Meydana Geldi"));

let lastID = 0;
setInterval(function () {
  pxstyEarthQuakes().then((a) => {
    if (lastID == 0) return (lastID = a[0].afadDepremID);
    if (a[0].afadDepremID != lastID) {
      console.log(`Yeni Deprem : ${a[0].tr}`);
    }
    lastID = a[0].afadDepremID;
  });
}, 2500);
0.0.3

1 year ago

0.0.2

1 year ago

1.0.0

1 year ago