pxsty.earthquakes

0.0.3 • Public • Published

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);

Package Sidebar

Install

npm i pxsty.earthquakes

Weekly Downloads

3

Version

0.0.3

License

MIT

Unpacked Size

4.89 kB

Total Files

4

Last publish

Collaborators

  • pxsty0