├── matahari.png ├── vercel.json ├── package.json ├── ai ├── LuminAI.js ├── Blackbox.js └── Thinkai.js ├── LICENSE ├── Readme.md ├── search ├── rumaysho.js ├── goodread.js ├── ypia.js ├── surah.js └── jadwalsholat.js ├── index.js ├── berita └── liputan6.js └── public ├── script.js ├── index.html └── style.css /matahari.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Lenwyy/Lenwy-REST-API/HEAD/matahari.png -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": 2, 3 | "builds": [ 4 | { 5 | "src": "index.js", 6 | "use": "@vercel/node" 7 | } 8 | ], 9 | "routes": [ 10 | { 11 | "src": "/(.*)", 12 | "dest": "index.js" 13 | } 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "nodejs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "keywords": [], 10 | "author": "", 11 | "license": "ISC", 12 | "dependencies": { 13 | "axios": "^1.6.8", 14 | "cors": "^2.8.5", 15 | "express": "^4.19.2", 16 | "node-fetch": "*", 17 | "cheerio": "*" 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ai/LuminAI.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | 3 | module.exports = function(app) { 4 | 5 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 6 | 7 | async function fetchContent(content) { 8 | try { 9 | const response = await axios.post('https://luminai.my.id/', { content }); 10 | return response.data; 11 | } catch (error) { 12 | console.error("Error fetching content from LuminAI:", error); 13 | throw error; 14 | } 15 | } 16 | 17 | // Endpoint LuminAI 18 | app.get('/luminai', async (req, res) => { 19 | try { 20 | const { text } = req.query; 21 | if (!text) { 22 | return res.status(400).json({ error: 'Parameter "text" Tidak Ditemukan, Tolong Masukkan Perintah' }); 23 | } 24 | const response = await fetchContent(text); 25 | res.status(200).json({ 26 | status: 200, 27 | creator: "Lenwy", 28 | data: response 29 | }); 30 | } catch (error) { 31 | res.status(500).json({ error: error.message }); 32 | } 33 | }); 34 | }; -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Lenwy 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | ☘️ Terimakasih kepada 2 | Allah Swt 3 | 4 | Kedua Orangtua Saya 5 | 6 | Penyedia Scraper 7 | 8 | Pengguna Bot Yang Selalu Support 9 | 10 | 📝 Credit : Lenwy 11 | 12 | 🥇 Pengembang : (Nama Kalian) 13 | 14 | 📣 Salam Hangat 15 | Halo Semua, Sebelumnya Terimakasih Bagi Kalian Yang Sudah Menggunakan Atau Bahkan Mengembangkan Script REST API Ini, Saya Sangat Berterimakasih Atas Segala Dukungan Yang Kalian Berikan, Disini Saya Mohon Bagi Kalian Yang Menggunakan Script REST API Ini Tolong Untuk Tidak Menghapus Credit Yang Tertera Disini, Terimakasihh. 16 | 17 | 📑 Informasi Lebih Lengkap : 18 | Whatsapp : wa.me/6283829814737 19 | Telegram : t.me/ilenwy 20 | Gmail : Ilenwyy@gmail.com 21 | Instagram : ilenwy_ 22 | Youtube : Lenwy 23 | 24 | 📦 Seputar Informasi : 25 | Grup Whatsapp : https://chat.whatsapp.com/LJViMFtwsTqLRSIY8aklKP 26 | Saluran Whatsapp : https://whatsapp.com/channel/0029VaGdzBSGZNCmoTgN2K0u 27 | 28 | Saya Lenwy Sangat Berterimakasih Dan Menghargai Tindakan Kalian Yang Sudah Membiarkan Credit Tertera Disini. 29 | 30 | ❤️ Terimakasihh. 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /search/rumaysho.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | module.exports = function(app) { 5 | 6 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 7 | 8 | async function scrapeTafsir(searchQuery) { 9 | const url = `https://rumaysho.com/?s=${encodeURIComponent(searchQuery)}`; 10 | try { 11 | const { data } = await axios.get(url); 12 | const $ = cheerio.load(data); 13 | const tafsirResults = []; 14 | $('.post-title a').each((index, element) => { 15 | const title = $(element).text().trim(); 16 | const link = $(element).attr('href'); 17 | tafsirResults.push({ title, link }); 18 | }); 19 | return tafsirResults; 20 | } catch (error) { 21 | console.error('Error fetching data:', error.message); 22 | return []; 23 | } 24 | } 25 | 26 | app.get('/rumaysho', async (req, res) => { 27 | const { search } = req.query; 28 | if (!search) { 29 | return res.status(400).json({ error: 'search parameter is required' }); 30 | } 31 | 32 | try { 33 | const results = await scrapeTafsir(search); 34 | res.status(200).json(results); 35 | } catch (error) { 36 | res.status(500).json({ error: 'Error fetching tafsir data' }); 37 | } 38 | }); 39 | }; 40 | -------------------------------------------------------------------------------- /ai/Blackbox.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | 3 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 4 | 5 | module.exports = function(app) { 6 | 7 | async function blackboxAIChat(message) { 8 | try { 9 | const response = await axios.post('https://www.blackbox.ai/api/chat', { 10 | messages: [{ id: null, content: message, role: 'user' }], 11 | id: null, 12 | previewToken: null, 13 | userId: null, 14 | codeModelMode: true, 15 | agentMode: {}, 16 | trendingAgentMode: {}, 17 | isMicMode: false, 18 | isChromeExt: false, 19 | githubToken: null 20 | }); 21 | 22 | return response.data; 23 | } catch (error) { 24 | throw error; 25 | } 26 | } 27 | 28 | // Endpoint untuk blackboxAIChat 29 | app.get('/blackboxai', async (req, res) => { 30 | try { 31 | const text = req.query.text; 32 | if (!text) { 33 | return res.status(400).json({ error: 'Parameter "text" tidak ditemukan' }); 34 | } 35 | const response = await blackboxAIChat(text); 36 | res.status(200).json({ 37 | status: 200, 38 | creator: "Lenwy", 39 | data: { response } 40 | }); 41 | } catch (error) { 42 | res.status(500).json({ error: error.message }); 43 | } 44 | }); 45 | }; 46 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const express = require('express'); 2 | const cors = require('cors'); 3 | const path = require('path'); 4 | 5 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 6 | 7 | const app = express(); 8 | const PORT = process.env.PORT || 3000; 9 | app.enable("trust proxy"); 10 | app.set("json spaces", 2); 11 | 12 | app.use(express.static(path.join(__dirname, 'public'))); 13 | 14 | // Middleware CORS 15 | app.use(cors()); 16 | 17 | // Import AI 18 | require('./ai/Blackbox')(app); 19 | require('./ai/LuminAI')(app); 20 | require('./ai/Thinkai')(app); 21 | 22 | // Import Berita 23 | require('./berita/liputan6')(app); 24 | 25 | // Import Search 26 | require('./search/goodread')(app); 27 | require('./search/ypia')(app); 28 | require('./search/rumaysho')(app); 29 | require('./search/surah')(app); 30 | require('./search/jadwalsholat')(app); 31 | 32 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 33 | 34 | // Endpoint untuk halaman HTML utama 35 | app.get('/', (req, res) => { 36 | res.sendFile(path.join(__dirname, 'public', 'index.html')); 37 | }); 38 | 39 | // Handle 404 error 40 | app.use((req, res, next) => { 41 | res.status(404).send("Sorry can't find that!"); 42 | }); 43 | 44 | // Handle error 45 | app.use((err, req, res, next) => { 46 | console.error(err.stack); 47 | res.status(500).send('Something broke!'); 48 | }); 49 | 50 | // Jalankan server 51 | app.listen(PORT, () => { 52 | console.log(`Server is running on port ${PORT}`); 53 | }); 54 | 55 | module.exports = app; 56 | -------------------------------------------------------------------------------- /search/goodread.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | module.exports = function(app) { 5 | 6 | 7 | async function avzzzz(query) { 8 | const url = `https://www.goodreads.com/search?q=${encodeURIComponent(query)}`; 9 | try { 10 | const { data } = await axios.get(url); 11 | const $ = cheerio.load(data); 12 | const books = []; 13 | $('.tableList tr').each((index, element) => { 14 | const title = $(element).find('a.bookTitle span').text().trim(); 15 | const link = $(element).find('a.bookTitle').attr('href'); 16 | const rating = $(element).find('span.minirating').text().trim(); 17 | books.push({ title, link: `https://www.goodreads.com${link}`, rating }); 18 | 19 | 20 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 21 | }); 22 | return books; 23 | } catch (error) { 24 | console.error('Error fetching data:', error.message); 25 | return []; 26 | } 27 | } 28 | 29 | app.get('/caribuku', async (req, res) => { 30 | const { search } = req.query; 31 | if (!search) { 32 | return res.status(400).json({ error: 'search parameter is required' }); 33 | } 34 | 35 | try { 36 | const results = await avzzzz(search); 37 | res.status(200).json(results); 38 | } catch (error) { 39 | res.status(500).json({ error: 'Error fetching book data' }); 40 | } 41 | }); 42 | }; 43 | -------------------------------------------------------------------------------- /search/ypia.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | module.exports = function(app) { 5 | 6 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 7 | 8 | async function scrapeTafsir(searchQuery) { 9 | const url = `https://ypia.or.id/?s=${encodeURIComponent(searchQuery)}`; 10 | try { 11 | const { data } = await axios.get(url, { 12 | headers: { 13 | 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36' 14 | } 15 | }); 16 | const $ = cheerio.load(data); 17 | const tafsirResults = []; 18 | $('.entry-title a').each((index, element) => { 19 | const title = $(element).text().trim(); 20 | const link = $(element).attr('href'); 21 | tafsirResults.push({ title, link }); 22 | }); 23 | return tafsirResults; 24 | } catch (error) { 25 | console.error('Error fetching data:', error.message); 26 | return []; 27 | } 28 | } 29 | 30 | app.get('/ypia', async (req, res) => { 31 | const { search } = req.query; 32 | if (!search) { 33 | return res.status(400).json({ error: 'search parameter is required' }); 34 | } 35 | 36 | try { 37 | const results = await scrapeTafsir(search); 38 | res.status(200).json(results); 39 | } catch (error) { 40 | res.status(500).json({ error: 'Error fetching tafsir data' }); 41 | } 42 | }); 43 | }; -------------------------------------------------------------------------------- /berita/liputan6.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | module.exports = function(app) { 5 | 6 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 7 | 8 | // Fungsi scraper liputan6 9 | async function liputan6() { 10 | try { 11 | const AvoskyBaik = await axios.get('https://www.liputan6.com/'); 12 | const $ = cheerio.load(AvoskyBaik.data); 13 | 14 | const latestNews = $('.articles--iridescent-list').eq(2).find('article'); 15 | const results = []; 16 | 17 | latestNews.each(function () { 18 | try { 19 | const title = $(this).find('figure a').attr('title'); 20 | const link = $(this).find('figure a').attr('href'); 21 | const image = $(this).find('figure a picture img').attr('data-src'); 22 | const tag = $(this).find('aside header a').text(); 23 | 24 | results.push({ title, link, tag, image, source: 'liputan6' }); 25 | } catch (e) { 26 | console.error('Error scraping article:', e); 27 | } 28 | }); 29 | 30 | return results; 31 | } catch (error) { 32 | console.error('Error fetching:', error); 33 | return []; 34 | } 35 | } 36 | 37 | // Endpoint untuk scraper liputan6 38 | app.get('/liputan6', async (req, res) => { 39 | try { 40 | const data = await liputan6(); 41 | if (data.length === 0) { 42 | return res.status(404).json({ message: 'Tidak ada berita terbaru yang ditemukan.' }); 43 | } 44 | 45 | res.status(200).json({ 46 | status: 200, 47 | creator: "Lenwy", 48 | data: data 49 | }); 50 | } catch (error) { 51 | res.status(500).json({ error: 'Terjadi kesalahan saat mengambil data.' }); 52 | } 53 | }); 54 | 55 | }; 56 | -------------------------------------------------------------------------------- /ai/Thinkai.js: -------------------------------------------------------------------------------- 1 | module.exports = function(app) { 2 | const axios = require('axios'); 3 | 4 | const api = axios.create({ 5 | baseURL: 'https://thinkany.ai/api', 6 | headers: { 7 | 'Content-Type': 'application/json', 8 | 'User-Agent': 'Mozilla/5.0 (Linux; Android 10; K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Mobile Safari/537.36', 9 | 'Referer': 'https://thinkany.ai/' 10 | } 11 | }); 12 | 13 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 14 | 15 | async function thinkany(content) { 16 | try { 17 | const newConversationData = { 18 | content, 19 | locale: "en", 20 | mode: "search", 21 | model: "claude-3-haiku", 22 | source: "all" 23 | }; 24 | 25 | const { data } = await api.post('/new-conversation', newConversationData); 26 | 27 | const chatData = { 28 | role: "user", 29 | content: data.data.content, 30 | conv_uuid: data.data.uuid, 31 | mode: data.data.mode, 32 | is_new: true, 33 | model: data.data.llm_model 34 | }; 35 | 36 | const chatResponse = await api.post('/chat', chatData); 37 | return chatResponse.data; 38 | } catch (error) { 39 | console.error('Error:', error); 40 | throw error; 41 | } 42 | } 43 | 44 | // Endpoint untuk ThinkAny Scraper 45 | app.get('/thinkany', async (req, res) => { 46 | try { 47 | const { text } = req.query; 48 | if (!text) { 49 | return res.status(400).json({ error: 'Parameter "text" tidak ditemukan.' }); 50 | } 51 | const response = await thinkany(text); 52 | res.status(200).json({ 53 | status: 200, 54 | creator: "Lenwy", 55 | data: response, 56 | }); 57 | } catch (error) { 58 | res.status(500).json({ error: error.message }); 59 | } 60 | }); 61 | }; 62 | -------------------------------------------------------------------------------- /search/surah.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | module.exports = function(app) { 5 | 6 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 7 | 8 | async function surah(no) { 9 | return new Promise(async (resolve, reject) => { 10 | axios.get(`https://kalam.sindonews.com/surah/${encodeURIComponent(no)}`) 11 | .then(({ data }) => { 12 | const $ = cheerio.load(data); 13 | const result = []; 14 | const ar = []; 15 | const id = []; 16 | const lt = []; 17 | 18 | // Mendapatkan link audio 19 | $('div.breadcrumb-new > ul > li:nth-child(5)').each((c, d) => { 20 | result.audio = $(d).find('a').attr('href').replace('surah', 'audioframe'); 21 | }); 22 | 23 | // Mendapatkan teks ayat dalam bahasa Arab 24 | $('div.ayat-arab').each((a, b) => { 25 | ar.push($(b).text()); 26 | }); 27 | 28 | // Mendapatkan terjemahan Indonesia 29 | $('li > div.ayat-text').each((e, f) => { 30 | id.push($(f).text().replace(',', '').trim()); 31 | }); 32 | 33 | // Mendapatkan transliterasi latin 34 | $('div.ayat-latin').each((g, h) => { 35 | lt.push($(h).text().trim()); 36 | }); 37 | 38 | // Menyusun hasil 39 | for (let i = 0; i < ar.length; i++) { 40 | result.push({ 41 | arab: ar[i], 42 | indo: id[i], 43 | latin: lt[i] 44 | }); 45 | } 46 | 47 | resolve(result); 48 | }) 49 | .catch(reject); 50 | }); 51 | } 52 | 53 | // Endpoint untuk mengambil surah 54 | app.get('/surah', async (req, res) => { 55 | const search = req.query.search; 56 | if (!search) { 57 | return res.status(400).json({ error: 'Parameter "search" Tidak Ditemukan, Tolong Masukkan Nomor Surah' }); 58 | } 59 | 60 | try { 61 | const hasil = await surah(search); 62 | res.status(200).json({ hasil }); 63 | } catch (error) { 64 | res.status(500).json({ error: error.message }); 65 | } 66 | }); 67 | }; 68 | -------------------------------------------------------------------------------- /search/jadwalsholat.js: -------------------------------------------------------------------------------- 1 | const axios = require('axios'); 2 | const cheerio = require('cheerio'); 3 | 4 | module.exports = function(app) { 5 | 6 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 7 | 8 | async function getJadwalSholat(city) { 9 | try { 10 | const url = `https://umrotix.com/jadwal-sholat/${encodeURIComponent(city)}`; 11 | const { data } = await axios.get(url); 12 | const $ = cheerio.load(data); 13 | const result = {}; 14 | 15 | // Mendapatkan nama kota 16 | result.kota = $("h1.text-center") 17 | .first() 18 | .text() 19 | .replace("Jadwal Sholat ", "") 20 | .trim(); 21 | 22 | // Mendapatkan jadwal sholat dan tanggal 23 | $("body > div > div.main-wrapper.scrollspy-action > div:nth-child(3)").each(function (a, b) { 24 | result.tanggal = $(b).find("> div:nth-child(2)").text(); 25 | 26 | result.jadwal = { 27 | imsak: $(b) 28 | .find("> div.panel.daily > div > div > div > div > div:nth-child(1) > p:nth-child(2)") 29 | .text(), 30 | subuh: $(b) 31 | .find("> div.panel.daily > div > div > div > div > div:nth-child(2) > p:nth-child(2)") 32 | .text(), 33 | dzuhur: $(b) 34 | .find("> div.panel.daily > div > div > div > div > div:nth-child(3) > p:nth-child(2)") 35 | .text(), 36 | ashar: $(b) 37 | .find("> div.panel.daily > div > div > div > div > div:nth-child(4) > p:nth-child(2)") 38 | .text(), 39 | maghrib: $(b) 40 | .find("> div.panel.daily > div > div > div > div > div:nth-child(5) > p:nth-child(2)") 41 | .text(), 42 | isyak: $(b) 43 | .find("> div.panel.daily > div > div > div > div > div:nth-child(6) > p:nth-child(2)") 44 | .text(), 45 | }; 46 | }); 47 | 48 | return result; 49 | } catch (error) { 50 | console.error('Error:', error); 51 | return "Terjadi kesalahan saat mengambil jadwal sholat."; 52 | } 53 | } 54 | 55 | // Endpoint untuk mendapatkan jadwal sholat 56 | app.get('/jadwalsholat', async (req, res) => { 57 | try { 58 | const { search } = req.query; 59 | if (!search) { 60 | return res.status(400).json({ error: 'Parameter "search" tidak ditemukan, harap masukkan nama kota.' }); 61 | } 62 | 63 | const response = await getJadwalSholat(search); 64 | res.status(200).json({ 65 | status: 200, 66 | creator: "Lenwy", 67 | data: response 68 | }); 69 | } catch (error) { 70 | res.status(500).json({ error: error.message }); 71 | } 72 | }); 73 | 74 | }; 75 | -------------------------------------------------------------------------------- /public/script.js: -------------------------------------------------------------------------------- 1 | // Tampilan Popup 2 | window.onload = function() { 3 | const popup = document.getElementById('popup'); 4 | const popupBackdrop = document.getElementById('popup-backdrop'); 5 | 6 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 7 | 8 | // Animasi 9 | setTimeout(() => { 10 | popup.classList.add('active'); 11 | popupBackdrop.classList.add('active'); 12 | }, 100); // Delay Animasi 13 | }; 14 | 15 | // Tombol X 16 | document.getElementById('close-popup').addEventListener('click', function() { 17 | const popup = document.getElementById('popup'); 18 | const popupBackdrop = document.getElementById('popup-backdrop'); 19 | 20 | // Tutup Popup 21 | popup.classList.remove('active'); 22 | popupBackdrop.classList.remove('active'); 23 | }); 24 | 25 | 26 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 27 | 28 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 29 | 30 | // Copy Dari Tag Pre 31 | function copyToClipboard() { 32 | var textToCopy = document.getElementById('codeBlock').innerText; 33 | navigator.clipboard.writeText(textToCopy).then(function() { 34 | 35 | var popup = document.getElementById('copyPopup'); 36 | popup.classList.add('show'); 37 | popup.classList.remove('hide'); 38 | 39 | setTimeout(function() { 40 | popup.classList.add('hide'); 41 | popup.classList.remove('show'); 42 | }, 2000); 43 | }, function(err) { 44 | console.error('Gagal menyalin teks:', err); 45 | }); 46 | } 47 | 48 | // Event Tombol Copy 49 | document.getElementById('copyButton').addEventListener('click', copyToClipboard); 50 | 51 | 52 | // Animasi Folder 53 | function toggleFolder(folderId, folderElement) { 54 | const folder = document.getElementById(folderId); 55 | const icon = folderElement.querySelector('.icon'); 56 | 57 | if (folder.classList.contains('open')) { 58 | folder.classList.remove('open'); 59 | icon.classList.remove('rotated'); 60 | } else { 61 | folder.classList.add('open'); 62 | icon.classList.add('rotated'); 63 | } 64 | } 65 | 66 | document.addEventListener('DOMContentLoaded', function() { 67 | 68 | // Full Kode Di Github Saya : https://github.com/Lenwyy/ 69 | 70 | // Update Waktu 71 | function updateTime() { 72 | const now = new Date(); 73 | const hours = now.getHours().toString().padStart(2, '0'); 74 | const minutes = now.getMinutes().toString().padStart(2, '0'); 75 | const seconds = now.getSeconds().toString().padStart(2, '0'); 76 | const timeString = `${hours}:${minutes}:${seconds}`; 77 | document.getElementById('jam').textContent = timeString; 78 | } 79 | setInterval(updateTime, 1000); 80 | updateTime(); 81 | 82 | // Update Tanggal 83 | function updateDate() { 84 | const now = new Date(); 85 | const year = now.getFullYear(); 86 | const month = (now.getMonth() + 1).toString().padStart(2, '0'); 87 | const day = now.getDate().toString().padStart(2, '0'); 88 | const dateString = `${day}-${month}-${year}`; 89 | document.getElementById('tanggal').textContent = dateString; 90 | } 91 | updateDate(); 92 | }); -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 |Lenwy API Merupakan Sebuah Website REST API Gratis Yang Tidak Memungut Biaya Sama Sekali, Saya Akan Senang Bila Anda Berniat Untuk Berpartisipasi Dalam Kemajuan Website Ini, Terimakasih :D
20 | 24 |Hi, Lenwy API Merupakan Sebuah Website Yang Menyediakan REST API Gratis
33 | 34 | 01 35 |Untuk Menggunakan End Point, Kirim Sebuah Permintaan GET kepada End Point yang Diinginkan Dengan Diikuti Parameter Berikut :
161 |163 | 164 | message: Isi Permintaan Kamu 165 |166 | 167 | 168 | 04 169 |
Respon Yang Diberikan Berupa Format JSON Dengan Struktur :
171 |
172 | {
173 | "status": 200,
174 | "creator": "Lenwy",
175 | "data": {
176 | "response": "Hasil Respon Permintaan Kamu"
177 | }
178 | }
179 |
180 |
181 | 05
182 | Berikut Merupakan Contoh implementasi Dalam Bentuk Case :
184 | 185 |
186 | case 'ai4': {
187 | if (!q) return lenwyreply(`☘️ *Mau Nanya Apa Sama Ai4Chat?*`)
188 | if (text.length > 500) return lenwyreply(`☘️ *Maksimal 500 Karakter*`)
189 | lenwyreply('☘️ *Sabar Yaa*')
190 | var lenwyai = await fetchJson(`https://api-lenwy.vercel.app/ai4chat?text=${q}`)
191 | var lenai = lenwyai.data
192 | await lenwyreply(lenai)
193 | }
194 | break
195 |
196 |
197 |
198 |
199 |
200 |
201 |
205 |
206 |
207 |
208 |
209 | 06
210 | Website REST API Ini Masih Dalam Tahap Perkembangan (BETA), Mohon Untuk Memaklumi Segala Kekurangannya, Terimakasih :D
212 |