Closed ariffb25 closed 3 years ago
let fetch = require('node-fetch')
let googleIt = require('google-it')
let handler = async (m, { conn, command, args }) => {
let full = /f$/i.test(command)
let text = args.join` if (!text) return conn.reply(m.chat, 'Tidak ada teks untuk di cari', m) let url = 'https://google.com/search?q=' + encodeURIComponent(text) let search = await googleIt({ query: text }) let msg = search.map(({ title, link, snippet }) => { return
${title}\n${link}\n${snippet} }).join
\n\n`
// let ss = await (await fetch('https://nurutomo.herokuapp.com/api/ssweb?delay=1000&url=' + encodeURIComponent(url) + '&full=' + full)).buffer()
let ss = await (await fetch('https://docs-jojo.herokuapp.com/api/ssweb_full?url=' + encodeURIComponent(url) + '&device=desktop')).buffer()
conn.sendFile(m.chat, ss, 'ssweb_full.jpg', url + '\n\n' + msg, m)
}
handler.help = ['google', 'googlef'].map(v => v + '
handler.admin = false handler.botAdmin = false
handler.fail = null
module.exports = handler
let fetch = require('node-fetch')
let handler = async (m, { conn, command, args }) => {
let full = /f$/i.test(command)
if (!args[0]) return conn.reply(m.chat, 'Tidak ada url', m)
let url = /https?:\/\//.test(args[0]) ? args[0] : 'https://' + args[0]
// let ss = await (await fetch('https://nurutomo.herokuapp.com/api/ssweb?delay=1000&url=' + encodeURIComponent(url) + '&full=' + full)).buffer()
// let ss = await (await fetch('https://api.apiflash.com/v1/urltoimage?access_key=pake apikey kamu sendiri&url=' + encodeURIComponent(url))).buffer()
let ss = await (await fetch('https://docs-jojo.herokuapp.com/api/ssweb_full?url=' + encodeURIComponent(url) + '&device=desktop')).buffer()
conn.sendFile(m.chat, ss, 'ssweb_full.jpg', url, m)
}
handler.help = ['ss', 'ssf'].map(v => v + '
handler.admin = false handler.botAdmin = false
handler.fail = null
module.exports = handler
https://nurutomo.herokuapp.com/api
pada perintah google/googef tidak berjalan dikarenakan web api nya ngga ada