import axios from "axios" import cheerio from "cheerio" const Base_url = "https://220.158.234.46/" const drakor = (query) => { return new Promise((resolve, reject) => { axios.get(`https://drakorasia.blog//?s=${query}&post_type=post`) .then(({ data }) => { const $ = cheerio.load(data) const hasil = []; $('#post > div ').each(function(a, b) { result = { status: 200, author: author, judul: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > a > h2').text().trim(), years: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > div.category.text-gray.font-normal.text-white.text-xs.truncate > a').text(), genre: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > div.genrenya.text-center.text-white.text-opacity-75.text-xs.mt-1').text().trim(), thumbnail: $(b).find('> div.thumbnail > a > img').attr('src'), url: $(b).find('> div.title.text-center.absolute.bottom-0.w-full.py-2.pb-4.px-3 > a').attr('href') } hasil.push(result) }) resolve(hasil) }) .catch(reject) }) } export { drakor } //module.exports = { Getongoing, Getdownload, Getdetail, Getsearch }