Skip to content

Instantly share code, notes, and snippets.

View ayashiiiyo's full-sized avatar
🎯
Focusing

Abella || Beginner ayashiiiyo

🎯
Focusing
View GitHub Profile
async function img2img(prompt, imageUrl) {
const start = await fetch(`https://fgsi.dpdns.org/api/ai/image/img2img?apikey=APIKEY_MU&prompt=${encodeURIComponent(prompt)}&url=${encodeURIComponent(imageUrl)}`).then(r => r.json())
let result
while (true) {
const poll = await fetch(start.data.pollUrl).then(r => r.json())
if (!poll.status) throw new Error('Polling gagal')
if (poll.data.status === 'Success') {
result = poll.data.result
break
}
import { load } from 'cheerio'
function scoreMatch(q, title) {
const query = q.toLowerCase().split(' ')
const text = title.toLowerCase()
let score = 0
for (let word of query) {
if (text.includes(word)) score++
}
import { load } from 'cheerio'
async function scSearch(q) {
const url = 'https://m.soundcloud.com/search?q=' + encodeURIComponent(q)
const res = await fetch(url, {
headers: {
'user-agent': 'Mozilla/5.0'
}
})
const html = await res.text()
async function scdl(url) {
const base = 'https://convertico.com/'
const headers = {
'accept': '*/*',
'origin': base,
'referer': base + 'soundcloud-downloader/',
'user-agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Mobile Safari/537.36 EdgA/147.0.0.0'
}
import { Canvas, loadImage, FontLibrary } from 'skia-canvas'
import fs from 'fs'
import path from 'path'
import { execSync } from 'child_process'
const FONT_URL = 'https://raw.githubusercontent.com/uploader762/dat2/main/uploads/ebea8a-1776501237434.ttf'
const FONT_PATH = './Poppins-Bold.ttf'
const BG_URL = 'https://raw.githubusercontent.com/uploader762/dat1/main/uploads/4f8284-1776503052781.jpg'
async function downloadFont(url, pathFile) {
import * as cheerio from "cheerio"
async function savetwitter(url) {
const body = new URLSearchParams({
q: url,
lang: "id",
cftoken: ""
})
const res = await fetch("https://savetwitter.net/api/ajaxSearch", {
import { load } from "cheerio"
let handler = async (m, { conn, args, command }) => {
try {
if (!args[0]) return m.reply(`*Example :* .${command} Al Fatihah`)
m.reply(global.wait)
const $ = load(await (await fetch("https://islamipedia.id/murottal/")).text())
const data = $(".surah-item").map((i, el) => ({
no: parseInt($(el).find("h5").text().split(".")[0]),
surah: ($(el).attr("data-title") || "").toLowerCase(),
import * as cheerio from "cheerio";
async function quran(query) {
const slug = query.toLowerCase().replace(/\s+/g, "-");
const url = `https://quran.nu.or.id/${slug}`;
const res = await fetch(url);
const html = await res.text();
const $ = cheerio.load(html);
function hitungMBG(uang) {
const pengeluaranPerHari = 319600000000
const hargaPorsi = 15000
const hariFloat = uang / pengeluaranPerHari
const tahun = Math.floor(hariFloat / 365)
const bulan = Math.floor((hariFloat % 365) / 30)
const hari = Math.floor(hariFloat % 30)
async function Roblox(username) {
const search = await fetch(`https://users.roblox.com/v1/users/search?keyword=${username}&limit=10`)
const searchJson = await search.json()
if (!searchJson.data || !searchJson.data.length) {
return { error: "User tidak ditemukan" }
}
const user = searchJson.data[0]
const userId = user.id