text: const axios = require('axios')
  const link = 'https://arugaz.herokuapp.com'
  const fileyt = 'https://raw.githubusercontent.com/ArugaZ/scraper-results/main/20201111_230923.jpg'
  const eroryt = 'https://raw.githubusercontent.com/ArugaZ/scraper-results/main/20201111_234624.jpg'
  
  const insta = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/ig?url=${url}`)
          .then((res) => {
              resolve(`${res.data.result}`)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const ytmp3 = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/yta?url=${url}`)
          .then((res) => {
              if (res.data.error) resolve({ status: 'error', link: eroryt, judul: res.data.error })
              if (Number(res.data.filesize.split(' MB')[0]) >= 10.00) resolve({ status: 'filesize', link: fileyt, judul: '[❗] An error has occurred. The audio file may be too large' })
              resolve({ status: 'success', link: res.data.result, size: res.data.filesize, thumb: res.data.thumb, judul: res.data.title })
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const ytmp4 = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/ytv?url=${url}`)
          .then((res) => {
              if (res.data.error) resolve({ status: 'error', link: eroryt, judul: res.data.error })
              if (Number(res.data.filesize.split(' MB')[0]) >= 10.00) resolve({ status: 'filesize', link: fileyt, judul: '[❗] An error has occurred. The audio file may be too large' })
              resolve({ status: 'success', link: res.data.result, size: res.data.filesize, thumb: res.data.thumb, judul: res.data.title })
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const stalkig = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/stalk?username=${url}`)
          .then((res) => {
              if (res.data.error) resolve(res.data.error)
              const text = `User: ${res.data.Username}\nName: ${res.data.Name}\nBio: ${res.data.Biodata}\nFollower: ${res.data.Jumlah_Followers}\nFollowing: ${res.data.Jumlah_Following}\nPost: ${res.data.Jumlah_Post}`
              resolve(text)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const stalkigpict = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/stalk?username=${url}`)
          .then((res) => {
              if (res.data.error) resolve('https://c4.wallpaperflare.com/wallpaper/976/117/318/anime-girls-404-not-found-glowing-eyes-girls-frontline-wallpaper-preview.jpg')
              resolve(`${res.data.Profile_pic}`)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const quote = async() => new Promise((resolve, reject) => {
      axios.get(`${link}/api/randomquotes`)
          .then((res) => {
              const text = `Author: ${res.data.author}\n\nQuote: ${res.data.quotes}`
              resolve(text)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const wiki = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/wiki?q=${url}`)
          .then((res) => {
              resolve(res.data.result)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const daerah = async() => new Promise((resolve, reject) => {
      axios.get(`${link}/daerah`)
          .then((res) => {
              resolve(res.data.result)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const jadwaldaerah = async(url) => new Promise((resolve, reject) => {
      axios.get(`https://api.haipbis.xyz/jadwalsholat?daerah=${url}`)
          .then((res) => {
              if (res.data.error) resolve(res.data.error)
              const text = `Jadwal Sholat ${url}\n\nImsyak: ${res.data.Imsyak}\nSubuh: ${res.data.Subuh}\nDzuhur: ${res.data.Dzuhur}\nAshar: ${res.data.Ashar}\nMaghrib: ${res.data.Maghrib}\nIsya: ${res.data.Isya}`
              resolve(text)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const cuaca = async(url) => new Promise((resolve, reject) => {
      axios.get(`https://rest.farzain.com/api/cuaca.php?id=${url}&apikey=O8mUD3YrHIy9KM1fMRjamw8eg`)
          .then((res) => {
              if (res.data.respon.cuaca == null) resolve('Sorry your area is not available')
              const text = `Cuaca di: ${res.data.respon.tempat}\n\nCuaca: ${res.data.respon.cuaca}\nAngin: ${res.data.respon.angin}\nDesk: ${res.data.respon.deskripsi}\nKelembapan: ${res.data.respon.kelembapan}\nSuhu: ${res.data.respon.suhu}\nUdara: ${res.data.respon.udara}`
              resolve(text)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const chord = async(url) => new Promise((resolve, reject) => {
      axios.get(`${link}/api/chord?q=${url}`)
          .then((res) => {
              if (res.data.error) resolve(res.data.error)
              resolve(res.data.result)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  const tulis = async(teks) => new Promise((resolve, reject) => {
      axios.get(`${link}/nulis?text=${encodeURIComponent(teks)}`)
          .then((res) => {
              resolve(`${res.data.result}`)
          })
          .catch((err) => {
              reject(err)
          })
  })
  
  module.exports = {
      insta,
      ytmp3,
      ytmp4,
      stalkig,
      stalkigpict,
      quote,
      wiki,
      daerah,
      jadwaldaerah,
      cuaca,
      chord,
      tulis
  }