Nurutomo / wabot-aq

WhatsApp Bot
GNU General Public License v3.0
709 stars 1.38k forks source link

API Nurotomo #31

Closed ariffb25 closed 3 years ago

ariffb25 commented 3 years ago

https://nurutomo.herokuapp.com/api

pada perintah google/googef tidak berjalan dikarenakan web api nya ngga ada

ariffb25 commented 3 years ago

untuk command .google

pake api orang aja dulu guys

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.tags = ['internet'] handler.command = /^googlef?$/i handler.owner = false handler.mods = false handler.premium = false handler.group = false handler.private = false

handler.admin = false handler.botAdmin = false

handler.fail = null

module.exports = handler

ariffb25 commented 3 years ago

untuk command .ssweb

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.tags = ['internet'] handler.command = /^ss(web)?f?$/i handler.owner = false handler.mods = false handler.premium = false handler.group = false handler.private = false

handler.admin = false handler.botAdmin = false

handler.fail = null

module.exports = handler