File size: 1,483 Bytes
a2b2aac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
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 } |