Best Python code snippet using fMBT_python
api.js
Source:api.js
...241router.get('/cekapikey', async (req, res, next) => {242 var apikeyInput = req.query.apikey;243244 if(!apikeyInput) return res.json(loghandler.notparam)245 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)246 var limit = 'undefined'247 if (apikeyInput == `${key}`) { limit = 'Unlimited!' }248249try {250 res.json({251 status : `active`,252 apikey : apikeyInput,253 limit : limit254 })255 256} catch (e) {257 res.sendFile(error)258 }259})260261router.get('/changekey', (req, res, next) => {262 var apikeyInput = req.query.apikey;263264 if (!apikeyInput) return res.json(loghandler.notparam)265 if (apikeyInput !== `${key}`) return res.sendFile(invalidKey)266267 try {268 kuhong.insert({269 apikey: apikeyInput270 })271 .then(() => {272 res.json({273 status: true,274 result: `Apikey "${apikeyInput}" Berhasil ditambahkan!`275 })276 })277 } catch (e) {278 console.log(e)279 res.sendFile(error)280 }281})282283router.get('/removekey', (req, res, next) => {284 var apikeyInput = req.query.apikey;285286 if (!apikeyInput) return res.json(loghandler.notparam)287 if (apikeyInput !== `${key}`) return res.sendFile(invalidKey)288289 try {290 kuhong.remove({291 apikey: apikeyInput292 })293 .then(() => {294 res.json({295 status: true,296 result: `Apikey "${apikeyInput}" Berhasil dihapus!`297 })298 })299 } catch (e) {300 console.log(e)301 res.sendFile(error)302 }303})304305router.get('/tiktod', async (req, res, next) => {306 var apikeyInput = req.query.apikey,307 url = req.query.url308309310 if(!apikeyInput) return res.json(loghandler.notparam)311 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)312 if (!url) return res.json(loghandler.noturl)313314 TikTokScraper.getVideoMeta(url, options)315 .then(vid => {316 console.log(vid)317 res.json({318 status: true,319 creator: `${creator}`,320 videoNoWm: vid321 })322 })323 .catch(e => {324 res.json(loghandler.invalidLink)325 })326})327328router.get('/tiktod/stalk', async (req, res, next) => {329 var apikeyInput = req.query.apikey,330 username = req.query.username331332 if(!apikeyInput) return res.json(loghandler.notparam)333 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)334 if (!username) return res.json(loghandler.notusername)335336337 TikTokScraper.getUserProfileInfo(username)338 .then(user => {339 res.json({340 status : true,341 creator : `${creator}`,342 result : user343 })344 })345 .catch(e => {346 res.json({347 status : false,348 creator : `${creator}`,349 message : "Username tidak ditemukan!"350 })351 })352})353354router.get('/randomquote', async (req, res, next) => {355 var apikeyInput = req.query.apikey356 357 if(!apikeyInput) return res.json(loghandler.notparam)358 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)359360 fetch(encodeURI(`https://api.zeks.xyz/api/quote?apikey=alpin1234567`))361 .then(response => response.json())362 .then(data => {363 var result = data;364 res.json({365 creator : `${creator}`,366 result367 })368 })369 .catch(e => {370 res.sendFile(error)371})372})373374375router.get('/infonpm', async (req, res, next) => {376 var apikeyInput = req.query.apikey,377 query = req.query.query378 379 if(!apikeyInput) return res.json(loghandler.notparam)380 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)381 if (!query) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter query"})382383 fetch(encodeURI(`https://registry.npmjs.org/${query}`))384 .then(response => response.json())385 .then(data => {386 var result = data;387 res.json({388 status : true,389 creator : `${creator}`,390 result,391 message : `jangan lupa Subscribe Youtube ${creator}`392 })393 })394 .catch(e => {395 res.sendFile(error)396})397})398399router.get('/jadwal-bioskop', (req, res) => {400var apikeyInput = req.query.apikey401402if(!apikeyInput) return res.json(loghandler.notparam)403if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)404const cheerio = require('cheerio')405406axios.get('https://jadwalnonton.com/now-playing')407.then(({ data }) => {408 const $ = cheerio.load(data)409 var title = []410 var url = []411 var img = []412 $('div.row > div.item > div.clearfix > div.rowl > div.col-xs-6 > a').get().map((rest) => {413 url.push($(rest).attr('href'))414 })415 $('div.row > div.item > div.clearfix > div.rowl > div.col-xs-6 > a > img').get().map((rest) => {416 title.push($(rest).attr('alt'))417 })418 $('div.row > div.item > div.clearfix > div.rowl > div.col-xs-6 > a > img').get().map((rest) => {419 img.push($(rest).attr('src'))420 })421 var result = []422 for (var i = 0; i < url.length; i++) {423 result.push({424 url: url[i],425 title: title[i],426 img: img[i]427 })428 }429 res.send({430 creator: `${creator}`,431 status: true,432 result: result433 })434 })435})436437438router.get('/short/tiny', async (req, res, next) => {439 var apikeyInput = req.query.apikey,440 url = req.query.url441442 if(!apikeyInput) return res.json(loghandler.notparam)443 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)444 if (!url) return res.json(loghandler.noturl)445446 request(`https://tinyurl.com/api-create.php?url=${url}`, function (error, response, body) {447 try {448 res.json({449 status : true,450 creator : `${creator}`,451 result : {452 link : `${body}`,453 },454 message : `jangan lupa Subscribe Youtube ${creator}`455 })456 } catch (e) {457 console.log('Error :', color(e,'red'))458 res.json(loghandler.invalidLink)459 }460 })461})462463router.get('/base', async (req, res, next) => {464 var type = req.query.type,465 encode = req.query.encode,466 decode = req.query.decode,467 apikeyInput = req.query.apikey;468 if (!apikeyInput) return res.json(loghandler.notparam)469 if (apikeyInput !== `${key}`) return res.sendFile(invalidKey)470 if (!type) return res.json({status: false, creator, code: 404, message: 'Masukan parameter type, type yang tersedia : base4 , base32'})471 if (type == 'base64' && encode){472 Base("b64enc", encode)473 .then(result => {474 res.json({475 status:true,476 creator: `${creator}`,477 result478 })479 })480 } else if (type == 'base64' && decode){481 Base("b64dec", decode)482 .then(result => {483 res.json({484 status: true,485 creator: `${creator}`,486 result487 })488 })489 } else if (type == 'base32' && encode){490 Base('b32enc', encode)491 .then(result => {492 res.json({493 status:true,494 creator: `${creator}`,495 result496 })497 })498 } else if (type == 'base32' && decode){499 Base('b32dec', decode)500 .then(result => {501 res.json({502 status:true,503 creator: `${creator}`,504 result505 })506 })507 } else if(!(encode || decode)){508 res.json({509 status:false,510 creator: `${creator}`,511 message: "tambahkan parameter encode/decode"512 })513 } else {514 res.sendFile(error)515 }516})517518router.get('/nulis', async (req, res, next) => {519 var apikeyInput = req.query.apikey,520 text = req.query.text521 522 if(!apikeyInput) return res.json(loghandler.notparam)523 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)524 if (!text) return res.json(loghandler.nottext)525526 try {527 var fontPath = __path + '/lib/font/Zahraaa.ttf'528 var inputPath = __path + '/lib/kertas/nulis.jpg'529 var outputPath = __path + '/tmp/hasil.jpg'530 spawn('convert', [531 inputPath,532 '-font',533 fontPath,534 '-size',535 '700x960',536 '-pointsize',537 '30',538 '-interline-spacing',539 '-7',540 '-annotate',541 '+170+222',542 text,543 outputPath544 ])545 .on('error', () => console.log('Error Nulis'))546 .on('exit', () =>547 {548 res.sendFile(outputPath)549 })550 } catch (e) {551 console.log(e);552 res.json(loghandler.erorr)553 }554})555556router.get('/nulis2', async (req, res, next) => {557 var apikeyInput = req.query.apikey,558 text = req.query.text559 560 if(!apikeyInput) return res.json(loghandler.notparam)561 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)562 if (!text) return res.json(loghandler.nottext)563564 try {565 var d = new Date566 var tgl = d.toLocaleDateString('id-Id')567 var hari = d.toLocaleDateString('id-Id', { weekday: 'long' })568 var fontPath = __path + '/lib/font/Zahraaa.ttf'569 var inputPath = __path + '/lib/kertas/nulis2.jpg'570 var outputPath = __path + '/tmp/hasil2.jpg'571 spawn('convert', [572 inputPath,573 '-font',574 fontPath,575 '-size',576 '1024x784',577 '-pointsize',578 '20',579 '-interline-spacing',580 '1',581 '-annotate',582 '+806+78',583 hari,584 '-font',585 fontPath,586 '-size',587 '1024x784',588 '-pointsize',589 '18',590 '-interline-spacing',591 '1',592 '-annotate',593 '+806+102',594 tgl,595 '-font',596 fontPath,597 '-size',598 '1024x784',599 '-pointsize',600 '20',601 '-interline-spacing',602 '-7.5',603 '-annotate',604 '+344+142',605 text,606 outputPath607 ])608 .on('error', () => console.log('Error Nulis2'))609 .on('exit', () => {610611 res.sendFile(outputPath)612 })613 } catch (e) {614 console.log(e);615 res.json(loghandler.erorr)616 }617})618619router.get('/textmaker', async (req, res, next) => {620 var theme = req.query.theme,621 text = req.query.text,622 text2 = req.query.text2,623 text3 = req.query.text3,624 apikeyInput = req.query.apikey;625 626 if(!apikeyInput) return res.json(loghandler.notparam)627 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)628 if (!theme) return res.json(loghandler.nottheme)629 if (theme != 'glitch' && theme != 'google-suggestion') return res.json(loghandler.notheme)630 if (!text) return res.json(loghandler.nottext)631632 if (theme == 'glitch') {633 if (!text2) return res.json(loghandler.nottext2)634 try {635 request.post({636 url: "https://photooxy.com/logo-and-text-effects/make-tik-tok-text-effect-375.html",637 headers: {638 'Content-Type': 'application/x-www-form-urlencoded'639 },640 body: `text_1=${text}&text_2=${text2}&login=OK`,641 }, (e,r,b) => {642 if (!e) {643 $ = cheerio.load(b)644 $(".thumbnail").find("img").each(function() {645 h = $(this).attr("src")646 var result = "https://photooxy.com/"+h647 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))648 .then(response => response.json())649 .then(data => {650 res.json({651 status : true,652 creator : creator,653 result : data.data.url654 })655 })656 })657 }658 })659 } catch (e) {660 console.log(e);661 res.sendFile(error)662 }663 } else if (theme == 'google-suggestion') {664 if (!text2) return res.json(loghandler.nottext2)665 if (!text3) return res.json(loghandler.nottext3)666 request.post({667 url: "https://photooxy.com/other-design/make-google-suggestion-photos-238.html",668 headers: {669 'Content-Type': 'application/x-www-form-urlencoded'670 },671 body: `text_1=${text}&text_2=${text2}&text_3=${text3}&login=OK`,672 }, (e,r,b) => {673 if (!e) {674 $ = cheerio.load(b)675 $(".thumbnail").find("img").each(function() {676 h = $(this).attr("src")677 var result = "https://photooxy.com/"+h678 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))679 .then(response => response.json())680 .then(data => {681 var urlnya = data.data.url,682 devare_url = data.data.devare_url;683 res.json({684 status : true,685 creator : `${creator}`,686 message : `jangan lupa Subscribe Youtube ${creator}`,687 result:{688 url:urlnya,689 devare_url: devare_url,690 info: 'url akan hilang setelah 2 menit'691 }692 })693 })694 })695 }696 }) 697 } else {698 res.sendFile(error)699 }700})701702router.get('/textmaker/game', async (req, res, next) => {703 var theme = req.query.theme,704 text = req.query.text,705 text2 = req.query.text2,706 text3 = req.query.text3,707 apikeyInput = req.query.apikey;708 709 if(!apikeyInput) return res.json(loghandler.notparam)710 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)711 if (!theme) return res.json(loghandler.nottheme)712 if (theme != 'pubg' && theme != 'battlefield') return res.json(loghandler.notheme)713 if (!text) return res.json(loghandler.nottext)714715 if (theme == 'pubg') {716 if (!text2) return rs.jso(loghandler.nottext2)717 try {718 request.post({719 url: "https://photooxy.com/battlegrounds/make-wallpaper-battlegrounds-logo-text-146.html",720 headers: {721 'Content-Type': 'application/x-www-form-urlencoded'722 },723 body: `text_1=${text}&text_2=${text2}&login=OK`,724 }, (e,r,b) => {725 if (!e) {726 $ = cheerio.load(b)727 $(".thumbnail").find("img").each(function() {728 h =$(this).attr("src")729 var result = "https://photooxy.com/"+h730 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))731 .then(response => response.json())732 .then(data => {733 var urlnya = data.data.url,734 devare_url = data.data.devare_url;735 res.json({736 status : true,737 creator : `${creator}`,738 message : `jangan lupa Subscribe Youtube ${creator}`,739 result:{740 url:urlnya,741 devare_url: devare_url,742 info: 'url akan hilang setelah 2 menit'743 }744 })745 })746 })747 }748 })749 } catch (e) {750 console.log(e);751 res.sendFile(error)752 }753 } else if (theme == 'battlefield') {754 if (!text2) return res.json(loghandler.nottext2)755 request.post({756 url: "https://photooxy.com/fps-game-effect/create-battlefield-4-rising-effect-152.html",757 headers: {758 'Content-Type': 'application/x-www-form-urlencoded'759 },760 body: `text_1=${text}&text_2=${text2}&login=OK`,761 }, (e,r,b) => {762 if (!e) {763 $ = cheerio.load(b)764 $(".thumbnail").find("img").each(function() {765 h = $(this).attr("src")766 var result = "https://photooxy.com/"+h767 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))768 .then(response => response.json())769 .then(data => {770 var urlnya = data.data.url,771 devare_url = data.data.devare_url;772 res.json({773 status : true,774 creator : `${creator}`,775 message : `jangan lupa Subscribe Youtube ${creator}`,776 result:{777 url:urlnya,778 devare_url: devare_url,779 info: 'url akan hilang setelah 2 menit'780 }781 })782 })783 })784 }785 }) 786 } else {787 res.sendFile(error)788 }789})790791router.get('/textmaker/senja', async (req, res, next) => {792 var theme = req.query.theme,793 text = req.query.text,794 text2 = req.query.text2,795 text3 = req.query.text3,796 apikeyInput = req.query.apikey;797 798 if(!apikeyInput) return res.json(loghandler.notparam)799 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)800 if (!theme) return res.json(loghandler.nottheme)801 if (theme != 'coffee-cup' && theme != 'coffee-cup2') return res.json(loghandler.notheme)802 if (!text) return res.json(loghandler.nottext)803804 if (theme == 'coffee-cup') {805 try {806 request.post({807 url: "https://photooxy.com/logo-and-text-effcts/put-any-text-in-to-coffee-cup-371.html",808 headers: {809 'Content-Type': 'application/x-www-form-urlencoded'810 },811 body: `text_1=${text}&login=OK`,812 }, (e,r,b) => {813 if (!e) {814 $ = cheerio.load(b)815 $(".thumbnail").find("img").each(function() {816 h = $(this).attr("src")817 var result = "https://photooxy.com/"+h818 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))819 .then(response => response.json())820 .then(data => {821 var urlnya = data.data.url,822 devare_url = data.data.devare_url;823 res.json({824 status : true,825 creator : `${creator}`,826 message : `jangan lupa Subscribe Youtube ${creator}`,827 result:{828 url:urlnya,829 devare_url: devare_url,830 info: 'url akan hilang setelah 2 menit'831 }832 })833 })834 })835 }836 })837 } catch (e) {838 console.log(e);839 res.sendFile(error)840 }841 } else if (theme == 'coffee-cup2') {842 request.post({843 url: "https://photooxy.com/logo-and-text-effects/put-your-text-on-a-coffee-cup--174.html",844 headers: {845 'Content-Type': 'application/x-www-form-urlencoded'846 },847 body: `text_1=${text}&login=OK`,848 }, (e,r,b) => {849 if (!e) {850 $ = cheerio.load(b)851 $(".thumbnail").find("img").each(function() {852 h = $(this).attr("src")853 var result = "https://photooxy.com/"+h854 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))855 .then(response => response.json())856 .then(data => {857 var urlnya = data.data.url,858 devare_url = data.data.devare_url;859 res.json({860 status : true,861 creator : `${creator}`,862 message : `jangan lupa Subscribe Youtube ${creator}`,863 result:{864 url:urlnya,865 devare_url: devare_url,866 info: 'url akan hilang setelah 2 menit'867 }868 })869 })870 })871 }872 }) 873 } else {874 res.sendFile(error)875 }876})877878router.get('/kisahnabi', async (req, res, next) => {879 var nabi = req.query.nabi,880 apikeyInput = req.query.apikey;881882 if (!apikeyInput) return res.json(loghandler.notparam)883 if (apikeyInput !== `${key}`) return res.sendFile(invalidKey)884 Searchnabi(nabi)885 .then(result => {886 res.json({887 creator: creator,888 result889 })890 })891 .catch(e => {892 console.log('Error :', color(e, 'red'))893 res.sendFile(error)894 })895})896897router.get('/infogempa', async (req, res, next) => {898 var apikeyInput = req.query.apikey899900 if (!apikeyInput) return res.json(loghandler.notparam)901 if (apikeyInput !== `${key}`) return res.sendFile(invalidKey)902 Gempa()903 .then(result => {904 res.json({905 creator: creator,906 result907 })908 })909 .catch(e => {910 console.log('Error :', color(e, 'red'))911 res.sendFile(error)912 })913})914915router.get('/hadits', async (req, res, next) => {916 var apikeyInput = req.query.apikey,917 kitab = req.query.kitab,918 nomor = req.query.nomor919 920 if(!apikeyInput) return res.json(loghandler.notparam)921 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)922 if (!kitab) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kitab"})923 if (!nomor) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter nomor"})924925 fetch(encodeURI(`https://hadits-api-zhirrr.vercel.app/books/${kitab}/${nomor}`))926 .then(response => response.json())927 .then(data => {928 var result = data;929 res.json({930 result931 })932 })933 .catch(e => {934 res.sendFile(error)935 })936})937 938router.get('/quran', async (req, res, next) => {939 var apikeyInput = req.query.apikey,940 surah = req.query.surah,941 ayat = req.query.ayat942 943 if(!apikeyInput) return res.json(loghandler.notparam)944 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)945 if (!surah) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter surah"})946 if (!ayat) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter ayat"})947948 fetch(encodeURI(`https://alquran-apiii.vercel.app/surah/${surah}/${ayat}`))949 .then(response => response.json())950 .then(data => {951 var result = data;952 res.json({953 result954 })955 })956 .catch(e => {957 res.sendFile(error)958})959})960961962router.get('/fbdown', async (req, res, next) => {963 var apikeyInput = req.query.apikey,964 url = req.query.url965 966 if(!apikeyInput) return res.json(loghandler.notparam)967 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)968 if (!url) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter url"})969970 fetch(encodeURI(`https://fb-api-zhirrr.vercel.app/?url=${url}`))971 .then(response => response.json())972 .then(data => {973 var result = data;974 res.json({975 result976 })977 })978 .catch(e => {979 res.sendFile(error)980})981})982983984router.get('/textmaker/metallic', async (req, res, next) => {985 var theme = req.query.theme,986 text = req.query.text,987 text2 = req.query.text2,988 text3 = req.query.text3,989 apikeyInput = req.query.apikey;990 991 if(!apikeyInput) return res.json(loghandler.notparam)992 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)993 if (!theme) return res.json(loghandler.nottheme)994 if (theme != 'neon' && theme != 'glow') return res.json(loghandler.notheme)995 if (!text) return res.json(loghandler.nottext)996997 if (theme == 'neon') {998 try {999 request.post({1000 url: "https://photooxy.com/logo-and-text-effects/illuminated-metallic-effect-177.html",1001 headers: {1002 'Content-Type': 'application/x-www-form-urlencoded'1003 },1004 body: `text_1=${text}&login=OK`,1005 }, (e,r,b) => {1006 if (!e) {1007 $ = cheerio.load(b)1008 $(".thumbnail").find("img").each(function() {1009 h = $(this).attr("src")1010 var result = "https://photooxy.com/"+h1011 fetch(encodeURI(`https://api.imgbb.om/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))1012 .then(response => response.json())1013 .then(data => {1014 var urlnya = data.data.url,1015 devare_url = data.data.devare_url;1016 res.json({1017 status : true,1018 creator : `${creator}`,1019 message : `jangan lupa Subscribe Youtube ${creator}`,1020 result:{1021 url:urlnya,1022 devare_url: devare_url,1023 info: 'url akan hilang setelah 2 menit'1024 }1025 })1026 })1027 })1028 }1029 })1030 } catch (e) {1031 console.log(e);1032 res.sendFile(error)1033 }1034 } else if (theme == 'glow') {1035 request.post({1036 url: "https://photooxy.com/other-design/create-metallic-text-glow-online-188.html",1037 headers: {1038 'Content-Type': 'application/x-www-form-urlencoded'1039 },1040 body: `text_1=${text}&login=OK`,1041 }, (e,r,b) => {1042 if (!e) {1043 $ = cheerio.load(b)1044 $(".thumbnail").find("img").each(function() {1045 h = $(this).attr("src")1046 var result = "https://photooxy.com/"+h1047 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))1048 .then(response => response.json())1049 .then(data => {1050 var urlnya = data.data.url,1051 devare_url = data.data.devare_url;1052 res.json({1053 status : true,1054 creator : `${creator}`,1055 message : `jangan lupa Subscribe Youtube ${creator}`,1056 result:{1057 url:urlnya,1058 devare_url: devare_url,1059 info: 'url akan hilang setelah 2 menit'1060 }1061 })1062 })1063 })1064 }1065 }) 1066 } else {1067 res.sendFile(error)1068 }1069})10701071router.get('/textmaker/alam', async (req, res, next) => {1072 var theme = req.query.theme,1073 text = req.query.text,1074 text2 = req.query.text2,1075 text3 = req.query.text3,1076 apikeyInput = req.query.apikey;1077 1078 if(!apikeyInput) return res.json(loghandler.notparam)1079 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1080 if (!theme) return res.json(loghandler.nottheme)1081 if (theme != 'summer' && theme != 'flower') return res.json(loghandler.notheme)1082 if (!text) return res.json(loghandler.nottext)10831084 if (theme == 'summer') {1085 try {1086 request.post({1087 url: "https://photooxy.com/logo-and-text-effects/3d-summer-text-effect-367.html",1088 headers: {1089 'Content-Type': 'application/x-www-form-urlencoded'1090 },1091 body: `text_1=${text}&login=OK`,1092 }, (e,r,b) => {1093 if (!e) {1094 $ = cheerio.load(b)1095 $(".thumbnai").find("img").each(function() {1096 h = $(this).attr("src")1097 var result = "https://photooxy.com/"+h1098 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))1099 .then(response => response.json())1100 .then(data => {1101 var urlnya = data.data.url,1102 devare_url = data.data.devare_url;1103 res.json({1104 status : true,1105 creator : `${creator}`,1106 message : `jangan lupa Subscribe Youtube ${creator}`,1107 result:{1108 url:urlnya,1109 devare_url: devare_url,1110 info: 'url akan hilang setelah 2 menit'1111 }1112 })1113 })1114 })1115 }1116 })1117 } catch (e) {1118 console.log(e);1119 res.sendFile(error)1120 }1121 } else if (theme == 'flower') {1122 request.post({1123 url: "https://photooxy.com/art-effects/flower-typography-text-effect-164.html",1124 headers: {1125 'Content-Type': 'application/x-www-form-urlencoded'1126 },1127 body: `text_1=${text}&login=OK`,1128 }, (e,r,b) => {1129 if (!e) {1130 $ = cheerio.load(b)1131 $(".thumbnail").find("img").each(function() {1132 h = $(this).attr("src")1133 var result = "https://photooxy.com/"+h1134 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))1135 .then(response => response.json())1136 .then(data => {1137 var urlnya = data.data.url,1138 devare_url = data.data.devare_url;1139 res.json({1140 status : true,1141 creator : `${creator}`,1142 message : `jangan lupa Subscribe Youtube ${creator}`,1143 result:{1144 url:urlnya,1145 devare_url: devare_url,1146 info: 'url akan hilang setelah 2 menit'1147 }1148 })1149 })1150 })1151 }1152 }) 1153 } else {1154 res.sendFile(error)1155 }1156})11571158router.get('/flaming', async (req, res, next) => {1159 var text = req.query.text,1160 apikeyInput = req.query.apikey;1161 1162 if(!apikeyInput) return res.json(loghandler.notparam)1163 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1164 if (!text) return res.json(loghandler.nottext)11651166 try {1167 var json = await (await fetch(`http://zekais-api.herokuapp.com/photooxy/flaming?text=${text}`)).json()1168 var buffer = await (await fetch(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${json.result}&name=ZeroYT7`)).json()1169 await fs.writeFileSync(__path + '/tmp/flaming.png', await getBuffer(buffer.data.url))1170 1171 res.sendFile(__path + '/tmp/flaming.png')1172 } catch (e) {1173 console.log(e);1174 res.sendFile(error)1175 }1176})11771178router.get('/neon', async (req, res, next) => {1179 var text = req.query.text,1180 apikeyInput = req.query.apikey;1181 1182 if(!apikeyInput) return res.json(loghandler.notparam)1183 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1184 if (!text) return res.json(loghandler.nottext)11851186 try {1187 var json = await (await fetch(`http://zekais-api.herokuapp.com/photooxy/neon?text=${text}`)).json()1188 var buffer = await (await fetch(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${json.result}&name=ZeroYT7`)).json()1189 await fs.writeFileSync(__path + '/tmp/neon.png', await getBuffer(buffer.data.url))1190 1191 res.sendFile(__path + '/tmp/neon.png')1192 } catch (e) {1193 console.log(e);1194 res.sendFile(error)1195 }1196})11971198router.get('/muslim/tahlil', async (req, res, next) => {1199 var apikeyInput = req.query.apikey1200 1201 if(!apikeyInput) return res.json(loghandler.notparam)1202 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)12031204 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataTahlil.json`))1205 .then(response => response.json())1206 .then(data => {1207 var result = data;1208 res.json({1209 result1210 })1211 })1212 .catch(e => {1213 res.sendFile(error)1214})1215})121612171218router.get('/muslim/wirid', async (req, res, next) => {1219 var apikeyInput = req.query.apikey1220 1221 if(!apikeyInput) return res.json(loghandler.notparam)1222 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)12231224 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataWirid.json`))1225 .then(response => response.json())1226 .then(data => {1227 var result = data;1228 res.json({1229 result1230 })1231 })1232 .catch(e => {1233 res.sendFile(error)1234})1235})123612371238router.get('/muslim/ayatkursi', async (req, res, next) => {1239 var apikeyInput = req.query.apikey1240 1241 if(!apikeyInput) return res.json(loghandler.notparam)1242 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)12431244 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataAyatKursi.json`))1245 .then(response => response.json())1246 .then(data => {1247 var result = data;1248 res.json({1249 result1250 })1251 })1252 .catch(e => {1253 res.sendFile(error)1254})1255})125612571258router.get('/muslim/doaharian', async (req, res, next) => {1259 var apikeyInput = req.query.apikey1260 1261 if(!apikeyInput) return res.json(loghandler.notparam)1262 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)12631264 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataDoaHarian.json`))1265 .then(response => response.json())1266 .then(data => {1267 var result = data;1268 res.json({1269 result1270 })1271 })1272 .catch(e => {1273 res.sendFile(error)1274})1275})127612771278router.get('/muslim/bacaanshalat', async (req, res, next) => {1279 var apikeyInput = req.query.apikey1280 1281 if(!apikeyInput) return res.json(loghandler.notparam)1282 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)12831284 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataBacaanShalat.json`))1285 .then(response => response.json())1286 .then(data => {1287 var result = data;1288 res.json({1289 result1290 })1291 })1292 .catch(e => {1293 res.sendFile(error)1294})1295})129612971298router.get('/muslim/niatshalat', async (req, res, next) => {1299 var apikeyInput = req.query.apikey1300 1301 if(!apikeyInput) return res.json(loghandler.notparam)1302 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)13031304 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataNiatShalat.json`))1305 .then(response => response.json())1306 .then(data => {1307 var result = data;1308 res.json({1309 result1310 })1311 })1312 .catch(e => {1313 res.sendFile(error)1314})1315})131613171318router.get('/muslim/kisahnabi', async (req, res, next) => {1319 var apikeyInput = req.query.apikey1320 1321 if(!apikeyInput) return res.json(loghandler.notparam)1322 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)13231324 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataKisahNabi.json`))1325 .then(response => response.json())1326 .then(data => {1327 var result = data;1328 res.json({1329 result1330 })1331 })1332 .catch(e => {1333 res.sendFile(error)1334})1335})133613371338router.get('/muslim/asmaulhusna', async (req, res, next) => {1339 var apikeyInput = req.query.apikey1340 1341 if(!apikeyInput) return res.json(loghandler.notparam)1342 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)13431344 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/dataAsmaulHusna.json`))1345 .then(response => response.json())1346 .then(data => {1347 var result = data;1348 res.json({1349 result1350 })1351 })1352 .catch(e => {1353 res.sendFile(error)1354})1355})135613571358router.get('/muslim/niatshubuh', async (req, res, next) => {1359 var apikeyInput = req.query.apikey1360 1361 if(!apikeyInput) return res.json(loghandler.notparam)1362 if(apikeyInput !== `${key}`) return res.jon(loghandler.invalidKey)13631364 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/NiatShubuh.json`))1365 .then(response => response.json())1366 .then(data => {1367 var result = data;1368 res.json({1369 result1370 })1371 })1372 .catch(e => {1373 res.sendFile(error)1374})1375})137613771378router.get('/muslim/niatdzuhur', async (req, res, next) => {1379 var apikeyInput = req.query.apikey1380 1381 if(!apikeyInput) return res.json(loghandler.notparam)1382 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)13831384 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/NiatDzuhur.json`))1385 .then(response => response.json())1386 .then(data => {1387 var result = data;1388 res.json({1389 result1390 })1391 })1392 .catch(e => {1393 res.sendFile(error)1394})1395})139613971398router.get('/muslim/niatmaghrib', async (req, res, next) => {1399 var apikeyInput = req.query.apikey1400 1401 if(!apikeyInput) return res.json(loghandler.notparam)1402 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)14031404 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/NiatMaghrib.json`))1405 .then(response => response.json())1406 .then(data => {1407 var result = data;1408 res.json({1409 result1410 })1411 })1412 .catch(e => {1413 res.sendFile(error)1414})1415})141614171418router.get('/muslim/niatisya', async (req, res, next) => {1419 var apikeyInput = req.query.apikey1420 1421 if(!apikeyInput) return res.json(loghandler.notparam)1422 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)14231424 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/NiatIsya.json`))1425 .then(response => response.json())1426 .then(data => {1427 var result = data;1428 res.json({1429 result1430 })1431 })1432 .catch(e => {1433 res.sendFile(error)1434})1435})143614371438router.get('/muslim/niatashar', async (req, res, next) => {1439 var apikeyInput = req.query.apikey1440 1441 if(!apikeyInput) return res.json(loghandler.notparam)1442 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)14431444 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/data/NiatAshar.json`))1445 .then(response => response.json())1446 .then(data => {1447 var result = data;1448 res.json({1449 result1450 })1451 })1452 .catch(e => {1453 res.sendFile(error)1454})1455})145614571458router.get('/wallpaper/cyberspace', async (req, res, next) => {1459 var apikeyInput = req.query.apikey1460 1461 if(!apikeyInput) return res.json(loghandler.notparam)1462 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)14631464 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/CyberSpace.json`))1465 .then(response => response.json())1466 .then(data => {1467 var result = data;1468 res.json({1469 result1470 })1471 })1472 .catch(e => {1473 res.sendFile(error)1474})1475})147614771478router.get('/wallpaper/teknologi', async (req, res, next) => {1479 var apikeyInput = req.query.apikey1480 1481 if(!apikeyInput) return res.json(loghandler.notparam)1482 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)14831484 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/Technology.json`))1485 .then(response => response.json())1486 .then(data => {1487 var result = data;1488 res.json({1489 result1490 })1491 })1492 .catch(e => {1493 res.sendFile(error)1494})1495})149614971498router.get('/wallpaper/muslim', async (req, res, next) => {1499 var apikeyInput =req.query.apikey1500 1501 if(!apikeyInput) return res.json(loghandler.notparam)1502 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)15031504 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/Islamic.json`))1505 .then(response => response.json())1506 .then(data => {1507 var result = data;1508 res.json({1509 result1510 })1511 })1512 .catch(e => {1513 res.sendFile(error)1514})1515})151615171518router.get('/wallpaper/programming', async (req, res, next) => {1519 var apikeyInput = req.query.apikey1520 1521 if(!apikeyInput) return res.json(loghandler.notparam)1522 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)15231524 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQL-Results/main/Programming.json`))1525 .then(response => response.json())1526 .then(data => {1527 var result = data;1528 res.json({1529 result1530 })1531 })1532 .catch(e => {1533 res.sendFile(error)1534})1535})153615371538router.get('/wallpaper/pegunungan', async (req, res, next) => {1539 var apikeyInput = req.query.apikey1540 1541 if(!apikeyInput) return res.json(loghandler.notparam)1542 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)15431544 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/My-SQ-Results/main/Mountain.json`))1545 .then(response => response.json())1546 .then(data => {1547 var result = data;1548 res.json({1549 result1550 })1551 })1552 .catch(e => {1553 res.sendFile(error)1554})1555})155615571558router.get('/wikipedia', async (req, res, next) => {1559 var apikeyInput = req.query.apikey,1560 search = req.query.search1561 1562 if(!apikeyInput) return res.json(loghandler.notparam)1563 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1564 if(!search) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter search"})15651566 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/wiki?keyword=${search}`))1567 .then(response => response.json())1568 .then(data => {1569 var result = data;1570 res.json({1571 result1572 })1573 })1574 .catch(e => {1575 res.sendFile(error)1576})1577})15781579router.get('/randomquote/muslim', async (req, res, next) => {1580 var apikeyInput = req.query.apikey1581 1582 if(!apikeyInput) return res.json(loghandler.notparam)1583 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)15841585 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/quote?type=agamis`))1586 .then(response => response.json())1587 .then(data => {1588 var result = data;1589 res.json({1590 result1591 })1592 })1593 .catch(e => {1594 res.sendFile(error)1595})1596})159715981599router.get('/drakorasia', async (req, res, next) => {1600 var apikeyInput = req.query.apikey,1601 search = req.query.searc1602 1603 if(!apikeyInput) return res.json(loghandler.notparam)1604 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1605 if(!search) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter search"})16061607 fetch(encodeURI(`http://docs-api-zahirrr.herokuapp.com/api/drakorasia?search=${search}`))1608 .then(response => response.json())1609 .then(data => {1610 var result = data;1611 res.json({1612 result1613 })1614 })1615 .catch(e => {1616 res.sendFile(error)1617})1618})161916201621router.get('/jadwalshalat', async (req, res, next) => {1622 var apikeyInput = req.query.apikey,1623 kota = req.query.kota1624 1625 if(!apikeyInput) return res.json(loghandler.notparam)1626 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1627 if(!kota) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kota"})16281629 fetch(encodeURI(`https://raw.githubusercontent.com/Zhirrr/Zhirrr-Database/main/adzan/${kota}/2021/03.json`))1630 .then(response => response.json())1631 .then(data => {1632 var result = data;1633 res.json({1634 result1635 })1636 })1637 .catch(e => {1638 res.sendFile(error)1639})1640})164116421643router.get('/fakedata', async (req, res, next) => {1644 var apikeyInput = req.query.apikey,1645 country = req.query.country1646 1647 if(!apikeyInput) return res.json(loghandler.notparam)1648 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1649 if(!country) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter country"})16501651 fetch(encodeURI(`https://fakename-api-zhirrr.vercel.app/api/fakename?country=${country}`))1652 .then(response => response.json())1653 .then(data => {1654 var result = data;1655 res.json({1656 result1657 })1658 })1659 .catch(e => {1660 res.sendFile(error)1661})1662})166316641665router.get('/hilih', async (req, res, next) => {1666 var apikeyInput = req.query.apikey,1667 kata = req.query.kata1668 1669 if(!apikeyInput) return res.json(loghandler.notparam)1670 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1671 if(!kata) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kata"})16721673 fetch(encodeURI(`https://hilih-api-zhirrr.vercel.app/api/hilih?kata=${kata}`))1674 .then(response => response.json())1675 .then(data => {1676 var result = data;1677 res.json({1678 result1679 })1680 })1681 .catch(e => {1682 res.sendFile(error)1683})1684})168516861687router.get('/liriklagu', async (req, res, next) => {1688 var apikeyInput = req.query.apikey,1689 lagu = req.query.lagu1690 1691 if(!apikeyInput) return res.json(loghandler.notparam)1692 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1693 if(!lagu) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kata"})16941695 var json = await (await fetch(`https://scrap.terhambar.com/lirik?word=${lagu}`)).json()1696 var result = json.result1697 res.json({1698 creatos : creator,1699 result : result1700 })1701})17021703router.get('/chordlagu', async (req, res, next) => {1704 var apikeyInput = req.query.apikey,1705 lagu = req.query.lagu1706 1707 if(!apikeyInput) return res.json(loghandler.notparam)1708 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1709 if(!lagu) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kata"})17101711 fetch(encodeURI(`https://python-api-zhirrr.herokuapp.com/api/chord?q=${lagu}`))1712 .then(response => response.json())1713 .then(data => {1714 var result = data;1715 res.json({1716 result1717 })1718 })1719 .catch(e => {1720 res.sendFile(error)1721})1722})172317241725router.get('/random/asmaulhusna', async (req, res, next) => {1726 var apikeyInput = req.query.apikey1727 1728 if(!apikeyInput) return res.json(loghandler.notparam)1729 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)17301731 fetch(encodeURI(`https://python-api-zhirrr.herokuapp.com/api/random/asmaulhusna`))1732 .then(response => response.json())1733 .then(data => {1734 var result = data;1735 res.json({1736 result1737 })1738 })1739 .catch(e => {1740 res.sendFile(error)1741})1742})174317441745router.get('/kbbi', async (req, res, next) => {1746 var apikeyInput = req.query.apikey,1747 kata = req.query.kata1748 1749 if(!apikeyInput) return res.json(loghandler.notparam)1750 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1751 if(!kata) return res.json({ status : false, creator: `${creator}`, message : "Masukan parameter kata"})17521753 fetch(encodeURI(`https://kbbi-api-zhirrr.vercel.app/api/kbbi?text=${kata}`))1754 .then(response => response.json())1755 .then(data => {1756 var result = data;1757 res.json({1758 result1759 })1760 })1761 .catch(e => {1762 res.sendFile(error)1763})1764})176517661767router.get('/covidindo', async (req, res, next) => {1768 var apikeyInput = req.query.apikey1769 1770 if(!apikeyInput) return res.json(loghandler.notparam)1771 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)17721773 fetch(encodeURI(`https://covid19-api-zhirrr.vercel.app/api/covid-indonesia`))1774 .then(response => response.json())1775 .then(data => {1776 var result = data;1777 res.json({1778 result1779 })1780 })1781 .catch(e => {1782 res.sendFile(error)1783})1784})178517861787router.get('/covidworld', async (req, res, next) => {1788 var apikeyInput = req.query.apikey1789 1790 if(!apikeyInput) return res.json(loghandler.notparam)1791 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)17921793 fetch(encodeURI(`https://covid19-api-zhirrr.vercel.app/api/world`))1794 .then(response => responsejson())1795 .then(data => {1796 var result = data;1797 res.json({1798 result1799 })1800 })1801 .catch(e => {1802 res.sendFile(error)1803})1804})180518061807router.get('/kodepos', async (req, res, next) => {1808 var apikeyInput = req.query.apikey,1809 kota = req.query.kota1810 1811 if(!apikeyInput) return res.json(loghandler.notparam)1812 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1813 if(!kota) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kota"})18141815 fetch(encodeURI(`https://kodepos-api-zhirrr.vercel.app/?q=${kota}`))1816 .then(response => response.json())1817 .then(data => {1818 var result = data;1819 res.json({1820 result1821 })1822 })1823 .catch(e => {1824 res.sendFile(error)1825})1826})182718281829router.get('/infocuaca', async (req, res, next) => {1830 var apikeyInput = req.query.apikey,1831 provinsi = req.query.provinsi1832 1833 if(!apikeyInput) return res.json(loghandler.notparam)1834 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1835 if(!provinsi) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter provinsi"})1836 fetch(encodeURI(`https://bmkg-api-zahirr.herokuapp.com/api/cuaca/${provinsi}`))1837 .then(response => response.json())1838 .then(data => {1839 var result = data;1840 res.json({1841 result1842 })1843 })1844 .catch(e => {1845 res.sendFile(error)1846})1847})184818491850router.get('/infocuaca/bandara', async (req, rs, next) => {1851 var apikeyInput = req.query.apikey1852 1853 if(!apikeyInput) return res.json(loghandler.notparam)1854 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1855 fetch(encodeURI(`https://bmkg-api-zahirr.herokuapp.com/api/cuaca/bandara`))1856 .then(response => response.json())1857 .then(data => {1858 var result = data;1859 res.json({1860 result1861 })1862 })1863 .catch(e => {1864 res.sendFile(error)1865})1866})186718681869router.get('/infocuaca/dunia', async (req, res, next) => {1870 var apikeyInput = req.query.apikey1871 1872 if(!apikeyInput) return res.json(loghandler.notparam)1873 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1874 fetch(encodeURI(`https://bmkg-api-zahirr.herokuapp.com/api/cuaca/dunia`))1875 .then(response => response.json())1876 .then(data => {1877 var result = data;1878 res.json({1879 result1880 })1881 })1882 .catch(e => {1883 res.sendFile(error)1884})1885})188618871888router.get('/infotsunami', async (req, res, next) => {1889 var apikeyInput = req.query.apikey1890 1891 if(!apikeyInput) return res.json(loghandler.notparam)1892 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1893 fetch(encodeURI(`https://bmkg-api-zahirr.herokuapp.com/api/tsunami`))1894 .then(response => response.json())1895 .then(data => {1896 var result = dta;1897 res.json({1898 result1899 })1900 })1901 .catch(e => {1902 res.sendFile(error)1903})1904})190519061907router.get('/random/meme', async (req, res, next) => {1908 var apikeyInput = req.query.apikey1909 1910 if(!apikeyInput) return res.json(loghandler.notparam)1911 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)19121913 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/meme`))1914 .then(response => response.json())1915 .then(data => {1916 var result = data;1917 res.json({1918 result1919 })1920 })1921 .catch(e => {1922 res.sendFile(error)1923})1924})192519261927router.get('/quotes/kanye', async (req, res, next) => {1928 var apikeyInput = req.query.apikey1929 1930 if(!apikeyInput) return res.json(loghandler.notparam)1931 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)19321933 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/quote?type=kanye`))1934 .then(response => response.json())1935 .then(data => {1936 var result = data;1937 res.json({1938 result1939 })1940 })1941 .catch(e => {1942 res.sendFile(error)1943})1944})194519461947router.get('/translate', async (req, res, next) => {1948 var apikeyInput = req.query.apikey,1949 kata = req.query.kata1950 1951 if(!apikeyInput) return res.json(loghandler.notparam)1952 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1953 if(!kata) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter kata"})1954 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/translate?text=${kata}`))1955 .then(response => response.json())1956 .then(data => {1957 var result = data;1958 res.json({1959 result1960 })1961 })1962 .catch(e => {1963 res.sendFile(error)1964})1965})196619671968router.get('/anime/kusonime', async (req, res, next) => {1969 var apikeyInput = req.query.apikey,1970 search = req.query.search1971 1972 if(!apikeyInput) return res.json(loghandler.notparam)1973 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)1974 if(!search) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter search"})1975 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/kusonime?search=${search}`))1976 .then(response => response.json())1977 .then(data => {1978 var result = data;1979 res.json({1980 result1981 })1982 })1983 .catch(e => {1984 res.sendFile(error)1985})1986})198719881989router.get('/gabut', async (req, res, next) => {1990 var apikeyInput = req.query.apikey1991 1992 if(!apikeyInput) return res.json(loghandler.notparam)1993 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)19941995 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/bosan`))1996 .then(response => response.json())1997 .then(data => {1998 var result = data;1999 res.json({2000 result2001 })2002 })2003 .catch(e => {2004 res.sendFile(error)2005})2006})200720082009router.get('/manga', async (req, res, next) => {2010 var apikeyInput = req.query.apikey,2011 search = req.query.search2012 2013 if(!apikeyInput) return res.json(loghandler.notparam)2014 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2015 if(!search) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter search"})2016 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/manga?keyword=${search}`))2017 .then(response => response.json())2018 .then(data => {2019 var result = data; res.json({2020 result2021 })2022 })2023 .catch(e => {2024 res.sendFile(error)2025})2026})202720282029router.get('/random/wallpaper', async (req, res, next) => {2030 var apikeyInput = req.query.apikey2031 2032 if(!apikeyInput) return res.json(loghandler.notparam)2033 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)20342035 fetch(encodeURI(`https://docs-api-zahirrr.herokuapp.com/api/random/wallpaper?genre=acak`))2036 .then(response => response.json())2037 .then(data => {2038 var result = data;2039 res.json({2040 result2041 })2042 })2043 .catch(e => {2044 res.sendFile(error)2045})2046})204720482049router.get('/kuis/caklontong', async (req, res, next) => {2050 var apikeyInput = req.query.apikey2051 2052 if(!apikeyInput) return res.json(loghandler.notparam)2053 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)20542055 fetch(encodeURI(`https://api-yogipw.herokuapp.com/api/kuis/caklontong?apikey=yogipw`))2056 .then(response => response.json())2057 .then(data => {2058 var result = data;2059 res.json({2060 author: 'ZeroYT7',2061 result2062 })2063 })2064 .catch(e => {2065 res.sendFile(error)2066})2067})20682069router.get('/kuis/tebakgambar', async (req, res, next) => {2070 var apikeyInput = req.query.apikey2071 2072 if(!apikeyInput) return res.json(loghandler.notparam)2073 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)20742075 fetch(encodeURI(`https://api.zeks.xyz/api/tebakgambar?apikey=alpin1234567`))2076 .then(response => response.json())2077 .then(data => {2078 var result = data;2079 res.json({2080 author: 'ZeroYT7',2081 result2082 })2083 })2084 .catch(e => {2085 res.sendFile(error)2086})2087})20882089router.get('/news/cnn', async (req, res, next) => {2090 var apikeyInput = req.query.apikey,2091 type = req.query.type2092 2093 if(!apikeyInput) return res.json(loghandler.notparam)2094 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2095 if (!type) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter type"})20962097 fetch(encodeURI(`https://news-api-zhirrr.vercel.app/v1/cnn-news/${type}`))2098 .then(response => response.json())2099 .then(data => {2100 var result = data;2101 res.json({2102 author: 'ZeroYT7',2103 result2104 })2105 })2106 .catch(e => {2107 res.sendFile(error)2108})2109})211021112112router.get('/news/cnbc', async (req, res, next) => {2113 var apikeyInput = req.query.apikey,2114 type = req.query.type2115 2116 if(!apikeyInput) return res.json(loghandler.notparam)2117 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2118 if (!type) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter type"})21192120 fetch(encodeURI(`https://news-api-zhirrr.vercel.app/v1/cnbc-news/${type}`))2121 .then(response => response.json())2122 .then(data => {2123 var result = data;2124 res.json({2125 author: 'ZeroYT7',2126 result2127 })2128 })2129 .catch(e => {2130 res.sendFile(error)2131})2132})213321342135router.get('/news/republika', async (req, res, next) => {2136 var apikeyInput = req.query.apikey,2137 type = req.query.type2138 2139 if(!apikeyInput) return res.json(loghandler.notparam)2140 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2141 if (!type) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter type"})21422143 fetch(encodeURI(`https://news-api-zhirrr.vercel.app/v1/republika-news/${type}`))2144 .then(response => response.json())2145 .then(data => {2146 var result = data;2147 res.json({2148 author: 'ZeroYT7',2149 result2150 })2151 })2152 .catch(e => {2153 res.sendFile(error)2154})2155})215621572158router.get('/news/tempo', async (req, res, next) => {2159 var apikeyInput = req.query.apikey,2160 type = req.query.type2161 2162 if(!apikeyInput) return res.json(loghandler.notparam)2163 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2164 if (!type) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter type"})21652166 fetch(encodeURI(`https://news-api-zhirrr.verce.app/v1/tempo-news/${type}`))2167 .then(response => response.json())2168 .then(data => {2169 var result = data;2170 res.json({2171 author: 'ZeroYT7',2172 result2173 })2174 })2175 .catch(e => {2176 res.sendFile(error)2177})2178})217921802181router.get('/news/antara', async (req, res, next) => {2182 var apikeyInput = req.query.apikey,2183 type = req.query.type2184 2185 if(!apikeyInput) return res.json(loghandler.notparam)2186 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2187 if (!type) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter type"})21882189 fetch(encodeURI(`https://news-api-zhirrr.vercel.app/v1/antara-news/${type}`))2190 .then(response => response.json())2191 .then(data => {2192 var result = data;2193 res.json({2194 author: 'ZeroYT7',2195 result2196 })2197 })2198 .catch(e => {2199 res.sendFile(error)2200})2201})220222032204router.get('/news/kumparan', async (req, res, next) => {2205 var apikeyInput = req.query.apikey2206 2207 if(!apikeyInput) return res.json(loghandler.notparam)2208 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)22092210 fetch(encodeURI(`https://news-api-zhirrr.vercel.app/v1/kumparan-news`))2211 .then(response => response.json())2212 .then(data => {2213 var result = data;2214 res.json({2215 author: 'ZeroYT7',2216 result2217 })2218 })2219 .catch(e => {2220 res.sendFile(error)2221})2222})222322242225router.get('/filmapik/search', async (req, res, next) => {2226 var apikeyInput = req.query.apikey,2227 film = req.query.film2228 2229 if(!apikeyInput) return res.json(loghandler.notparam)2230 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2231 if (!film) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter film"})22322233 fetch(encodeURI(`https://filmapik-api-zahirr.herokuapp.com/search?q=${film}`))2234 .then(response => response.json())2235 .then(data => {2236 var result = data;2237 res.json({2238 author: 'ZeroYT7',2239 result2240 })2241 })2242 .catch(e => {2243 res.sendFile(error)2244})2245})224622472248router.get('/filmapik/kategori', async (req, res, next) => {2249 var apikeyInput = req.query.apikey,2250 film = req.query.film2251 2252 if(!apikeyInput) return res.json(loghandler.notparam)2253 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2254 if (!film) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter film"})22552256 fetch(encodeURI(`https://filmapik-api-zahirr.herokuapp.com/category?search=${film}`))2257 .then(response => response.json())2258 .then(data => {2259 var result = data;2260 res.json({2261 author: 'ZeroYT7',2262 result2263 })2264 })2265 .catch(e => {2266 res.sendFile(error)2267})2268})226922702271router.get('/filmapik/play', async (req, res, next) => {2272 var apikeyInput = req.query.apikey,2273 id = req.query.id2274 2275 if(!apikeyInput) return res.json(loghandler.notparam)2276 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2277 if (!id) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter id"})22782279 fetch(encodeURI(`https://filmapik-api-zahirr.herokuapp.com/play?id=${id}`))2280 .then(response => response.json())2281 .then(data => {2282 var result = data;2283 res.json({2284 author: 'ZeroYT7',2285 result2286 })2287 })2288 .catch(e => {2289 res.sendFile(error)2290})2291})229222932294router.get('/filmapik/terbaru', async (req, res, next) => {2295 var apikeyInput = req.query.apikey2296 2297 if(!apikeyInput) return res.json(loghandler.notparam)2298 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)22992300 fetch(encodeURI(`https://filmapik-api-zahirr.herokuapp.com/latest`))2301 .then(response => response.json())2302 .then(data => {2303 var result = data;2304 res.json({2305 author: 'ZeroYT7',2306 result2307 })2308 })2309 .catch(e => {2310 res.sendFile(error)2311})2312})231323142315router.get('/lk21/search', async (req, res, next) => {2316 var apikeyInput = req.query.apikey,2317 film = req.query.film2318 2319 if(!apikeyInput) return res.json(loghandler.notparam)2320 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2321 if (!film) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter film"})23222323 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/search?query=${film}`))2324 .then(response => response.json())2325 .then(data => {2326 var result = data;2327 res.json({2328 author: 'ZeroYT7',2329 result2330 })2331 })2332 .catch(e => {2333 res.sendFile(error)2334})2335})23362337router.get('/playstore', async (req, res, next) => {2338 var apikeyInput = req.query.apikey,2339 namaapk = req.query.namaapk2340 2341 if(!apikeyInput) return res.json(loghandler.notparam)2342 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2343 if (!namaapk) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter nama apk"})23442345 fetch(encodeURI(`https://api.zeks.xyz/api/sgplay?apikey=apivinz&q=${namaapk}`))2346 .then(response => response.json())2347 .then(data => {2348 var result = data;2349 res.json({2350 author: 'ZeroYT7',2351 result2352 })2353 })2354 .catch(e => {2355 res.sendFile(error)2356})2357})23582359router.get('/happymod', async (req, res, next) => {2360 var apikeyInput = req.query.apikey,2361 namaapk = req.query.namaapk2362 2363 if(!apikeyInput) return res.json(loghandler.notparam)2364 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2365 if (!namaapk) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter nama apk"})23662367 fetch(encodeURI(`https://api.zeks.xyz/api/happymod?apikey=apivinz&q=${namaapk}`))2368 .then(response => response.json())2369 .then(data => {2370 var result = data;2371 res.json({2372 author: 'ZeroYT7',2373 result2374 })2375 })2376 .catch(e => {2377 res.sendFile(error)2378})2379})23802381router.get('/Gsm', async (req, res, next) => {2382 var apikeyInput = req.query.apikey,2383 ygdicarik = req.query.ygdicarik2384 2385 if(!apikeyInput) return res.json(loghandler.notparam)2386 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2387 if (!ygdicarik) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter nama ygdicarik"})23882389 fetch(encodeURI(`https://api.zeks.xyz/api/gsmArena?apikey=apivinz&q=${ygdicarik}`))2390 .then(response => response.json())2391 .then(data => {2392 var result = data;2393 res.json({2394 author: 'ZeroYT7',2395 result2396 })2397 })2398 .catch(e => {2399 res.sendFile(error)2400})2401})24022403router.get('/sticker', async (req, res, next) => {2404 var apikeyInput = req.query.apikey,2405 nama = req.query.nama2406 2407 if(!apikeyInput) return res.json(loghandler.notparam)2408 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2409 if (!nama) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter nama"})24102411 fetch(encodeURI(`https://api.zeks.xyz/api/searchsticker?apikey=apivinz&q=${nama}`))2412 .then(response => response.json())2413 .then(data => {2414 var result = data;2415 res.json({2416 author: 'ZeroYT7',2417 result2418 })2419 })2420 .catch(e => {2421 res.sendFile(error)2422})2423})24242425router.get('/sticker/line', async (req, res, next) => {2426 var apikeyInput = req.query.apikey,2427 link = req.query.link2428 2429 if(!apikeyInput) return res.json(loghandler.notparam)2430 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2431 if (!link) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter link"})24322433 fetch(encodeURI(`https://api.zeks.xyz/api/linesticker?link=${link}&apikey=apivinz`))2434 .then(response => response.json())2435 .then(data => {2436 var result = data;2437 res.json({2438 author: 'ZeroYT7',2439 result2440 })2441 })2442 .catch(e => {2443 res.sendFile(error)2444})2445})24462447router.get('/sticker/telegram', async (req, res, next) => {2448 var apikeyInput = req.query.apikey,2449 link = req.query.link2450 2451 if(!apikeyInput) return res.json(loghandler.notparam)2452 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2453 if (!link) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter link"})24542455 fetch(encodeURI(`https://api.zeks.xyz/api/telegram-sticker?apikey=apivinz&url={link}`))2456 .then(response => response.json())2457 .then(data => {2458 var result = data;2459 res.json({2460 author: 'ZeroYT7',2461 result2462 })2463 })2464 .catch(e => {2465 res.sendFile(error)2466})2467})24682469router.get('/jadwal/tv', async (req, res, next) => {2470 var apikeyInput = req.query.apikey,2471 channel = req.query.channel2472 2473 if(!apikeyInput) return res.json(loghandler.notparam)2474 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2475 if (!channel) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter channel"})24762477 fetch(encodeURI(`https://api.zeks.xyz/api/jadwaltv?channel=${channel}&apikey=apivinz`))2478 .then(response => response.json())2479 .then(data => {2480 var result = data;2481 res.json({2482 author: 'ZeroYT7',2483 result2484 })2485 })2486 .catch(e => {2487 res.sendFile(error)2488})2489})24902491router.get('/iguser', async (req, res, next) => {2492 var apikeyInput = req.query.apikey,2493 nama = req.query.nama2494 2495 if(!apikeyInput) return res.json(loghandler.notparam)2496 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2497 if (!nama) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter nama"})24982499 fetch(encodeURI(`https://api.zeks.xyz/api/iguser?apikey=apivinz&q=${nama}`))2500 .then(response => response.json())2501 .then(data => {2502 var result = data;2503 res.json({2504 author: 'ZeroYT7',2505 result2506 })2507 })2508 .catch(e => {2509 res.sendFile(error)2510})2511})25122513router.get('/lk21/terbaru', async (req, res, next) => {2514 var apikeyInput = req.query.apikey2515 2516 if(!apikeyInput) return res.json(loghandler.notparam)2517 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)25182519 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/newupload`))2520 .then(response => response.json())2521 .then(data => {2522 var result = data;2523 res.json({2524 author: 'ZeroYT7',2525 result2526 })2527 })2528 .catch(e => {2529 res.sendFile(error)2530})2531})253225332534router.get('/lk21/comingsoon', async (req, res, next) => {2535 var apikeyInput = req.query.apikey2536 2537 if(!apikeyInput) return res.json(loghandler.notparam)2538 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)25392540 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/comingsoon`))2541 .then(response => response.json())2542 .then(data => {2543 var result = data;2544 res.json({2545 author: 'ZeroYT7',2546 result2547 })2548 })2549 .catch(e => {2550 res.sendFile(error)2551})2552})255325542555router.get('/lk21/tvseries', async (req, res, next) => {2556 var apikeyInput = req.query.apikey2557 2558 if(!apikeyInput) return res.json(loghandler.notparam)2559 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)25602561 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/tv`))2562 .then(response => response.json())2563 .then(data => {2564 var result = data;2565 res.json({2566 author: 'ZeroYT7',2567 result2568 })2569 })2570 .catch(e => {2571 res.sendFile(error)2572})2573})257425752576router.get('/lk21/year', async (req, res, next) => {2577 var apikeyInput = req.query.apikey,2578 tahun = req.query.tahun2579 2580 if(!apikeyInput) return res.json(loghandler.notparam)2581 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2582 if (!tahun) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter tahun"})25832584 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/year?year=${tahun}`))2585 .then(response => response.json())2586 .then(data => {2587 var result = data;2588 res.json({2589 author: 'ZeroYT7',2590 result2591 })2592 })2593 .catch(e => {2594 res.sendFile(error)2595})2596})259725982599router.get('/lk21/country', async (req, res, next) => {2600 var apikeyInput = req.query.apikey,2601 negara = req.query.negara2602 2603 if(!apikeyInput) return res.json(loghandler.notparam)2604 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2605 if (!negara) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter negara"})26062607 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/country?country=${negara}`))2608 .then(response => response.json())2609 .then(data => {2610 var result = data;2611 res.json({2612 author: 'ZeroYT7', result2613 })2614 })2615 .catch(e => {2616 res.sendFile(error)2617})2618})261926202621router.get('/lk21/genre', async (req, res, next) => {2622 var apikeyInput = req.query.apikey,2623 tipe = req.query.tipe2624 2625 if(!apikeyInput) return res.json(loghandler.notparam)2626 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2627 if (!tipe) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter tipe"})26282629 fetch(encodeURI(`https://lk21-api-zahirr.herokuapp.com/genre?genre=${tipe}`))2630 .then(response => response.json())2631 .then(data => {2632 var result = data;2633 res.json({2634 author: 'ZeroYT7',2635 result2636 })2637 })2638 .catch(e => {2639 res.sendFile(error)2640})2641})264226432644router.get('/textmaker/random', async (req, res, next) => {2645 var theme = req.query.theme,2646 text = req.query.text,2647 text2 = req.query.text2,2648 text3 = req.query.text3,2649 apikeyInput = req.query.apikey;2650 2651 if(!apikeyInput) return res.json(loghandler.notparam)2652 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2653 if (!theme) return res.json(loghandler.nottheme)2654 if (theme != 'text-burn' && theme != 'art-quote') return res.json(loghandler.notheme)2655 if (!text) return res.json(loghandler.nottext)26562657 if (theme == 'text-burn') {2658 try {2659 request.post({2660 url: "https://photooxy.com/logo-and-text-effects/write-text-on-burn-paper-388.html",2661 headers: {2662 'Content-Type': 'application/x-www-form-urlencoded'2663 },2664 body: `text_1=${text}&login=OK`,2665 }, (e,r,b) => {2666 if (!e) {2667 $ = cheerio.load(b)2668 $(".thumbnail").find("img").each(function() {2669 h = $(this).attr("src")2670 var result = "https://photooxy.com/"+h2671 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))2672 .then(response => response.json())2673 .then(data => {2674 var urlnya = data.data.url,2675 devare_url = data.data.devare_url;2676 res.json({2677 status : true,2678 creator : `${creator}`,2679 message : `jangan lupa Subscribe Youtube ${creator}`,2680 result:{2681 url:urlnya,2682 devare_url: devare_url,2683 info: 'url akan hilang setelah 2 menit'2684 }2685 })2686 })2687 })2688 }2689 })2690 } catch (e) {2691 console.log(e);2692 res.sendFile(error)2693 }2694 } else if (theme == 'art-quote') {2695 request.post({2696 url: "https://photooxy.com/logo-and-text-effects/write-art-quote-on-wood-heart-370.html",2697 headers: {2698 'Content-Type': 'application/x-www-form-urlencoded'2699 },2700 body: `text_1=${text}&login=OK`,2701 }, (e,r,b) => {2702 if (!e) {2703 $ = cheerio.load(b)2704 $(".thumbnail").find("img").each(function() {2705 h = $(this).attr("src")2706 var result = "https://photooxy.com/"+h2707 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))2708 .then(response => response.json())2709 .then(data => {2710 var urlnya = data.data.url,2711 devare_url = data.data.devare_url;2712 res.json({2713 status : true,2714 creator : `${creator}`,2715 message : `jangan lupa Subscribe Youtube ${creator}`,2716 result:{2717 url:urlnya,2718 devare_url: devare_url,2719 info: 'url akan hilang setelah 2 menit'2720 }2721 })2722 })2723 })2724 }2725 }) 2726 } else {2727 res.sendFile(error)2728 }2729})27302731router.get('/textmaker/roses', async (req, res, next) => {2732 var theme = req.query.theme,2733 text = req.query.text,2734 text2 = req.query.text2,2735 text3 = req.query.text3,2736 apikeyInput = req.query.apikey;2737 2738 if(!apikeyInput) return res.json(loghandler.notparam)2739 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2740 if (!theme) return res.json(loghandler.nottheme)2741 if (theme != 'wooden-boarch' && theme != 'golden') return res.json(loghandler.notheme)2742 if (!text) return res.json(loghandler.nottext)27432744 if (theme == 'wooden-boarch') {2745 try {2746 request.post({2747 url: "https://photooxy.com/logo-and-text-effects/writing-on-wooden-boards-368.html",2748 headers: {2749 'Content-Type': 'application/x-www-form-urlencoded'2750 },2751 body: `text_1=${text}&login=OK`,2752 }, (e,r,b) => {2753 if (!e) {2754 $ = cheerio.load(b)2755 $(".thumbnail").find("img").each(function() {2756 h = $(this).attr("src")2757 var result = "https://photooxy.com/"+h2758 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))2759 .then(response => response.json())2760 .then(data => {2761 var urlnya = data.data.url,2762 devare_url = data.data.devare_url;2763 res.json({2764 status : true,2765 creator : `${creator}`,2766 message : `jangan lupa Subscribe Youtube ${creator}`,2767 result:{2768 url:urlnya,2769 devare_url: devare_url,2770 info: 'url akan hilang setelah 2 menit'2771 }2772 })2773 })2774 })2775 }2776 })2777 } catch (e) {2778 console.log(e);2779 res.sendFile(error)2780 }2781 } else if (theme == 'golden') {2782 request.post({2783 url: "https://photooxy.com/logo-and-text-effects/yellow-roses-text-360.html",2784 headers: {2785 'Content-Type': 'application/x-www-form-urlencoded'2786 },2787 body: `text_1=${text}&login=OK`,2788 }, (e,r,b) => {2789 if (!e) {2790 $ = heerio.load(b)2791 $(".thumbnail").find("img").each(function() {2792 h = $(this).attr("src")2793 var result = "https://photooxy.com/"+h2794 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=761ea2d5575581057a799d14e9c78e28&image=${result}&name=${randomTextNumber}`))2795 .then(response => response.json())2796 .then(data => {2797 var urlnya = data.data.url,2798 devare_url = data.data.devare_url;2799 res.json({2800 status : true,2801 creator : `${creator}`,2802 message : `jangan lupa Subscribe Youtube ${creator}`,2803 result:{2804 url:urlnya,2805 devare_url: devare_url,2806 info: 'url akan hilang setelah 2 menit'2807 }2808 })2809 })2810 })2811 }2812 }) 2813 } else {2814 res.sendFile(error)2815 }2816})28172818router.get('/yutub/video', async (req, res, next) => {2819 var apikeyInput = req.query.apikey,2820 url = req.query.url2821 2822 if(!apikeyInput) return res.json(loghandler.notparam)2823 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2824 if (!url) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter url"})28252826 fetch(encodeURI(`https://api.zeks.xyz/api/ytmp4?url=${url}&apikey=alpin1234567`))2827 .then(response => response.json())2828 .then(data => {2829 var result = data;2830 res.json({2831 author: 'ZeroYT7',2832 result2833 })2834 })2835 .catch(e => {2836 res.sendFile(error)2837})2838})283928402841router.get('/yutub/audio', async (req, res, next) => {2842 var apikeyInput = req.query.apikey,2843 url = req.query.url2844 2845 if(!apikeyInput) return res.json(loghandler.notparam)2846 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2847 if (!url) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter url"})28482849 fetch(encodeURI(`https://api.zeks.xyz/api/ytmp3?url=${url}&apikey=alpin1234567`))2850 .then(response => response.json())2851 .then(data => {2852 var result = data;2853 res.json({2854 author: 'ZeroYT7',2855 result2856 })2857 })2858 .catch(e => {2859 res.sendFile(error)2860})2861})286228632864router.get('/ig/stalk', async (req, res, next) => {2865 var apikeyInput = req.query.apikey,2866 username = req.query.username2867 2868 if(!apikeyInput) return res.json(loghandler.notparam)2869 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2870 if (!username) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter username"})28712872 fetch(encodeURI(`https://mhankbarbar.herokuapp.com/api/stalk?username=${username}`))2873 .then(response => response.json())2874 .then(data => {2875 var result = data;2876 res.json({2877 author: 'ZeroYT7',2878 result2879 })2880 })2881 .catch(e => {2882 res.sendFile(error)2883})2884})28852886router.get('/comik', async (req, res, next) => {2887 var apikeyInput = req.query.apikey,2888 search = req.query.search2889 2890 if(!apikeyInput) return res.json(loghandler.notparam)2891 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2892 if (!search) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter username"})28932894 fetch(encodeURI(`https://api.zeks.xyz/api/bacakomik?apikey=alpin1234567&q=${search}`))2895 .then(response => response.json())2896 .then(data => {2897 var result = data;2898 res.json({2899 author: 'ZeroYT7',2900 result2901 })2902 })2903 .catch(e => {2904 res.sendFile(error)2905})2906})29072908router.get('/dork', async (req, res, next) => {2909 var apikeyInput = req.query.apikey,2910 dork = req.query.dork2911 2912 if(!apikeyInput) return res.json(loghandler.notparam)2913 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2914 if (!dork) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter dork"})29152916 fetch(encodeURI(`https://api-anoncybfakeplayer.herokuapp.com/dorking?dork=${dork}`))2917 .then(response => response.json())2918 .then(data => {2919 var result = data;2920 res.json({2921 author: 'ZeroYT7',2922 result2923 })2924 })2925 .catch(e => {2926 res.sendFile(error)2927})2928})29292930router.get('/pastebin', async (req, res, next) => {2931 var apikeyInput = req.query.apikey,2932 text = req.query.text2933 2934 if(!apikeyInput) return res.json(loghandler.notparam)2935 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2936 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})29372938 fetch(encodeURI(`https://api-anoncybfakeplayer.herokuapp.com/pastebin?text=${text}`))2939 .then(response => response.json())2940 .then(data => {2941 var result = data;2942 res.json({2943 author: 'ZeroYT7',2944 result2945 })2946 })2947 .catch(e => {2948 res.sendFile(error)2949})2950})29512952router.get('/maker', async (req, res, next) => {2953 var apikeyInput = req.query.apikey,2954 text = req.query.text2955 2956 if(!apikeyInput) return res.json(loghandler.notparam)2957 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2958 if (!text) return res.json(loghandler.nottext)29592960 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/textmaker?text=${text}`))2961 .then(response => response.json())2962 .then(data => {2963 var result = data;2964 res.json({2965 author: 'ZeroYT7',2966 result2967 })2968 })2969 .catch(e => {2970 res.sendFile(error)2971})2972})297329742975router.get('/maker2', async (req, res, next) => {2976 var apikeyInput = req.query.apikey,2977 text = req.query.text2978 2979 if(!apikeyInput) return res.json(loghandler.notparam)2980 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)2981 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})29822983 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/textmaker2?text=${text}`))2984 .then(response => response.json())2985 .then(data => {2986 var result = data;2987 res.json({2988 author: 'ZeroYT7',2989 result2990 })2991 })2992 .catch(e => {2993 res.sendFile(error)2994})2995})299629972998router.get('/maker3', async (req, res, next) => {2999 var apikeyInput = req.query.apikey,3000 text = req.query.text3001 3002 if(!apikeyInput) return res.json(loghandler.notparam)3003 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3004 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})30053006 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/textmaker3?text=${text}`))3007 .then(response => response.json())3008 .then(data => {3009 var result = data;3010 res.json({3011 author: 'ZeroYT7',3012 result3013 })3014 })3015 .catch(e => {3016 res.sendFile(error)3017})3018})301930203021router.get('/maker4', async (rq, res, next) => {3022 var apikeyInput = req.query.apikey,3023 text = req.query.text3024 3025 if(!apikeyInput) return res.json(loghandler.notparam)3026 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3027 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})30283029 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/textmaker4?text=${text}`))3030 .then(response => response.json())3031 .then(data => {3032 var result = data;3033 res.json({3034 author: 'ZeroYT7',3035 result3036 })3037 })3038 .catch(e => {3039 res.sendFile(error)3040})3041})304230433044router.get('/maker3d', async (req, res, next) => {3045 var apikeyInput = req.query.apikey,3046 text = req.query.text3047 3048 if(!apikeyInput) return res.json(loghandler.notparam)3049 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3050 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})30513052 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/text3d?text=${text}`))3053 .then(response => response.json())3054 .then(data => {3055 var result = data;3056 res.json({3057 author: 'ZeroYT7',3058 result3059 })3060 })3061 .catch(e => {3062 res.sendFile(error)3063})3064})306530663067router.get('/maker3d/no2', async (req, res, next) => {3068 var apikeyInput = req.query.apikey,3069 text = req.query.text3070 3071 if(!apikeyInput) return res.json(loghandler.notparam)3072 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3073 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})30743075 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/text3d-2?text=${text}`))3076 .then(response => response.json())3077 .then(data => {3078 var result = data;3079 res.json({3080 author: 'ZeroYT7',3081 result3082 })3083 })3084 .catch(e => {3085 res.sendFile(error)3086})3087})308830893090router.get('/maker3d/no3', async (req, res, next) => {3091 var apikeyInput = req.query.apikey,3092 text = req.qery.text3093 3094 if(!apikeyInput) return res.json(loghandler.notparam)3095 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3096 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})30973098 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/text3d-3?text=${text}`))3099 .then(response => response.json())3100 .then(data => {3101 var result = data;3102 res.json({3103 author: 'ZeroYT7',3104 result3105 })3106 })3107 .catch(e => {3108 res.sendFile(error)3109})3110})311131123113router.get('/maker3d/no4', async (req, res, next) => {3114 var apikeyInput = req.query.apikey,3115 text = req.query.text3116 3117 if(!apikeyInput) return res.json(loghandler.notparam)3118 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3119 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})31203121 fetch(encodeURI(`https://textmaker-api-zahirr.herokuapp.com/api/text3d-4?text=${text}`))3122 .then(response => response.json())3123 .then(data => {3124 var result = data;3125 res.json({3126 author: 'ZeroYT7',3127 result3128 })3129 })3130 .catch(e => {3131 res.sendFile(error)3132})3133})313431353136router.get('/yutub/search', async (req, res, next) => {3137 var apikeyInput = req.query.apikey,3138 video = req.query.video3139 3140 if(!apikeyInput) return res.json(loghandler.notparam)3141 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3142 if (!video) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter video"})31433144 fetch(encodeURI(`https://api.zeks.xyz/api/yts?q=${video}&apikey=alpin1234567`))3145 .then(response => response.json())3146 .then(data => {3147 var result = data;3148 res.json({3149 author: 'ZeroYT7',3150 result3151 })3152 })3153 .catch(e => {3154 res.sendFile(error)3155})3156})315731583159router.get('/maker/special/transformer', async (req, res, next) => {3160 var apikeyInput = req.query.apikey,3161 text = req.query.text3162 3163 if(!apikeyInput) return res.json(loghandler.notparam)3164 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3165 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})3166 try {3167 var json = await (await fetch(`https://textmaker-api-zahirr.herokuapp.com/api/special/transformer?text=${text}`)).json()3168 var buffer = await getBuffer(json.results)3169 await fs.writeFileSync(__path + '/tmp/transformer.png', buffer)31703171 res.sendFile(__path + '/tmp/transformer.png')3172 } catch (e) {3173 console.log(e)3174 res.sendFile(error)3175 }3176})31773178router.get('/maker/special/epep', async (req, res, next) => {3179 var apikeyInput = req.query.apikey,3180 text = req.query.text3181 3182 if(!apikeyInput) return res.json(loghandler.notparam)3183 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3184 if (!text) return res.json({ status : false, creator : `${creator}`, message : "Masukan parameter text"})31853186 try {3187 var json = await (await fetch(`https://textmaker-api-zahirr.herokuapp.com/api/special/sertifikatepep?text=${text}`)).json()3188 var buffer = await getBuffer(json.results)3189 await fs.writeFileSync(__path + '/tmp/epepserti.png', buffer)31903191 res.sendFile(__path + '/tmp/epepserti.png')3192 } catch (e) {3193 console.log(e)3194 res.sendFile(error)3195 }3196})31973198router.get('/tomp4', async (req, res, next) => {3199 var url = req.query.url,3200 apikeyInput = req.query.apikey;3201 3202 if(!apikeyInput) return res.json(loghandler.notparam)3203 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3204 if (!url) return res.json(loghandler.noturl)3205 if (!url.startsWith('http')) return res.json(loghandler.invalidLink)32063207try {3208 axios.get(`https://ezgif.com/webp-to-mp4?url=${url}`).then(({ data }) => {3209 var $ = cheerio.load(data)3210 var bodyFormThen = new FormData()3211 var file = $('input[name="file"]').attr('value')3212 var token = $('input[name="token"]').attr('value')3213 var convert = $('input[name="file"]').attr('value')3214 var gotdata = {3215 file: file,3216 token: token,3217 convert: convert3218 }3219 bodyFormThen.append('file', gotdata.file)3220 bodyFormThen.append('token', gotdata.token)3221 bodyFormThen.append('convert', gotdata.convert)3222 axios({3223 method: 'post',3224 url: 'https://ezgif.com/webp-to-mp4/' + gotdata.file,3225 data: bodyFormThen,3226 headers: {3227 'Content-Type': `multipart/form-data; boundary=${bodyFormThen._boundary}`3228 }}).then(({ data }) => {3229 var $ = cheerio.load(data)3230 var result = 'https:' + $('div#output > p.outfile > video > source').attr('src')32313232 res.json({3233 status : true,3234 creator : `${creator}`,3235 message : `jangan lupa Subscribe Youtube ${creator}`,3236 result : result3237 })3238 })3239 })32403241 } catch (e) {3242 console.log(e);3243 res.sendFile(error)3244 }3245})32463247router.get('/ocr', async (req, res, next) => {3248 var apikeyInput = req.query.apikey,3249 img = req.query.img;3250 3251 if(!apikeyInput) return res.json(loghandler.notparam)3252 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3253 if (!img) return res.json(loghandler.notimg)3254 if (!img.startsWith('http')) return res.json(loghandler.invalidLink)32553256 try {3257 var enc = await imageToBase64(img)3258 var media = Buffer.from(enc, 'base64')3259 await fs.writeFileSync(__path + '/tmp/ocr.png', media)3260 await recognize(`${__path}/tmp/ocr.png`, { lang: 'eng+ind', oem: 1, psm: 3 })3261 .then(hasil => {32623263 res.json({3264 status : true,3265 creator : `${creator}`,3266 message : `jangan lupa Subscribe Youtube ${creator}`,3267 result : `${hasil}`3268 })3269 })3270 .catch(err => {3271 res.sendFile(error)3272 })3273 } catch (e) {3274 console.log(e);3275 res.sendFile(error)3276 }3277})32783279router.get('/removebg', async (req, res, next) => {3280 var apikeyInput = req.query.apikey,3281 img = req.query.img;32823283 try {3284 if(!apikeyInput) return res.json(loghandler.notparam)3285 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3286 if (!img) return res.json(loghandler.notimg)3287 if (!img.startsWith('http')) return res.json(loghandler.invalidLink)32883289 var encmedia = await imageToBase64(img)3290 var media = Buffer.from(encmedia, 'base64')3291 await fs.writeFileSync(__path + '/tmp/nobg.png', media)3292 var rbg = RemoveBg('HCVrssExQw8DuaWpj2vE5359', 'error.log')3293 rbg.remove_background_from_img_file(__path + '/tmp/nobg.png')32943295 res.sendFile(__path + '/tmp/nobg.png')3296 } catch (e) {3297 console.log(e);3298 res.sendFile(error)3299 }3300})33013302router.get('/simsimi', async (req, res, next) => {3303 var kata = req.query.kata,3304 apikeyInput = req.query.apikey;33053306 if(!apikeyInput) return res.json(loghandler.notparam)3307 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3308 if (!kata) return res.json(loghandler.notkata)33093310 try {3311 var json = await (await fetch(`https://api.zeks.xyz/api/simi?apikey=apivinz&text=${kata}`)).json()3312 var result = json.success3313 res.json({3314 status : true,3315 creator : `${creator}`,3316 result : result3317 })3318} catch (e) {3319 console.log(e)3320 res.sendFile(error)3321 }3322})33233324router.get('/binary', async (req, res, next) => {3325 var apikeyInput = req.query.apikey,3326 text = req.query.encode33273328 if(!apikeyInput) return res.json(loghandler.notparam)3329 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3330 if (!text) return res.json(loghandler.nottext)33313332 try {3333 var json = await (await fetch(`https://some-random-api.ml/binary?encode=${text}`)).json()3334 var result = json.binary3335 res.json({3336 status : true,3337 creator : `${creator}`,3338 result : result3339 })3340} catch (e) {3341 res.sendFile(error)3342 }3343})33443345router.get('/binary', async (req, res, next) => {3346 var apikeyInput = req.query.apikey,3347 text = req.query.decode;33483349 if(!apikeyInput) return res.json(loghandler.notparam)3350 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3351 if (!text) return res.json(loghandler.nottext)33523353 try {3354 var json = await (await fetch(`https://some-random-api.ml/binary?decode=${text}`)).json()3355 var result = json.text3356 res.json({3357 status : true,3358 creator : `${creator}`,3359 result : result3360 })3361} catch (e) {3362 res.sendFile(error)3363 }3364})33653366router.get('/tobase64', async (req, res, next) => {3367 var apikeyInput = req.query.apikey,3368 img = req.query.img;33693370 if(!apikeyInput) return res.json(loghandler.notparam)3371 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3372 if (!img) return res.json(loghandler.notimg)33733374 try {3375 var result = await imageToBase64(img)3376 res.json({3377 status : true,3378 creator : `${creator}`,3379 result : result3380 })3381} catch (e) {3382 res.sendFile(error)3383 }3384})33853386router.get('/tomedia', async (req, res, next) => {3387 var apikeyInput = req.query.apikey,3388 base64 = req.query.base64;33893390 if(!apikeyInput) return res.json(loghandler.notparam)3391 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3392 if (!base64) return res.json(loghandler.notbase64)3393 if (base64.startsWith('data')) return res.json({ message : `Gunakan teks base64 tanpa data:image/jpeg!` })33943395 try {3396 var result = Buffer.from(base64, 'base64')3397 res.sendFile(result)3398} catch (e) {3399 res.sendFile(error)3400 }3401})34023403router.get('/ttp', async (req, res, next) => {3404 var text = req.query.text,3405 apikeyInput = req.query.apikey;34063407 if(!apikeyInput) return res.json(loghandler.notparam)3408 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3409 if (!text) return res.json(loghandler.nottext)34103411 try {3412 var json = await (await fetch(`https://api.areltiyan.site/sticker_maker?text=${text}`)).json()3413 var hasil = json.base64.split`,`[1]3414 await fs.writeFileSync(__path + `/tmp/ttp.png`, hasil, 'base64')34153416 res.sendFile(__path + '/tmp/ttp.png')3417 } catch (e) {3418 console.log(e)3419 res.sendFile(error)3420 }3421})34223423router.get('/dadu', async (req, res, next) => {3424 var apikeyInput = req.query.apikey34253426 if(!apikeyInput) return res.json(loghandler.notparam)3427 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)34283429 var random = Math.floor(Math.random() * 6) + 13430 var hasil = 'https://www.random.org/dice/dice' + random + '.png'3431 var data = await (await fetch(hasil)).buffer()34323433 await fs.writeFileSync(__path + '/tmp/dadu.png', data)3434 res.sendFile(__path + '/tmp/dadu.png')3435})34363437router.get('/repeat', (req, res, next) => {34383439const repeat = (text, total) => {3440 return text.repeat(total)3441 }3442 var text = req.query.text,3443 jumlah = req.query.jumlah,3444 apikeyInput = req.query.apikey;34453446 if(!apikeyInput) return res.json(loghandler.notparam)3447 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3448 if (!text) return res.json(loghandler.nottext)3449 if (!jumlah) return res.json(loghandler.notjumlah)3450 if (isNaN(jumlah)) return res.json(loghandler.number)3451 if (jumlah > 10000) return res.json({ message: `Maximal 10rb Kali!` })34523453 var result = repeat(text, jumlah)3454 res.json({3455 status: true,3456 creator: `${creator}`,3457 result: result3458 })3459})34603461router.get('/reverse', async (req, res, next) => {3462 var text = req.query.text,3463 apikeyInput = req.query.apikey;34643465 if(!apikeyInput) return res.json(loghandler.notparam)3466 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3467 if (!text) return res.json(loghandler.nottext)34683469 try {3470 var json = await (await fetch(`https://videfikri.com/api/hurufterbalik/?query=${text}`)).json()3471 var result = json.result.kata3472 res.json({3473 status : true,3474 creator : `${creator}`,3475 result : result3476 })3477} catch (e) {3478 res.sendFile(error)3479 }3480})34813482router.get('/spamcall', async (req, res, next) => {3483 var nomor = req.query.nomor,3484 apikeyInput = req.query.apikey;34853486 if(!apikeyInput) return res.json(loghandler.notparam)3487 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3488 if (!nomor) return res.json(loghandler.notnomor)3489 if (isNaN(nomor)) return res.json(loghandler.number)34903491 try {3492 var json = await (await fetch(`https://mhankbarbar.herokuapp.com/api/spamcall?no=${nomor}`)).json()3493 res.json(json)34943495} catch (e) {3496 res.sendFile(error)3497 }3498})34993500router.get('/spamsms', async (req, res, next) => {3501 var nomor = req.query.nomor,3502 jumlah = req.query.jumlah,3503 apikeyInput = req.query.apikey;35043505 if(!apikeyInput) return res.json(loghandler.notparam)3506 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3507 if (!nomor) return res.json(loghandler.notnomor)3508 if (isNaN(nomor)) return res.json(loghandler.number)3509 if (!jumlah) return res.json(loghandler.notjumlah)3510 if (isNaN(jumlah)) return res.json(loghandler.number)3511 if (jumlah > 20) return res.json({ message: `Maximal 20 Bang` })35123513 try {3514 var json = await (await fetch(`https://mhankbarbar.herokuapp.com/api/spamsms?no=${nomor}&jum=${jumlah}`)).json()3515 res.json(json)35163517} catch (e) {3518 res.sendFile(error)3519 }3520})35213522router.get('/bokep', async (req, res, next) => {3523 var apikeyInput = req.query.apikey;35243525 if(!apikeyInput) return res.json(loghandler.notparam)3526 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)35273528 try {3529 var json = await (await fetch(`https://mhankbarbar.herokuapp.com/api/pussy`)).json()3530 var hasil = await getBuffer(json.result)3531 await fs.writeFileSync(__path + '/tmp/bokep.png', hasil)35323533 res.sendFile(__path + '/tmp/bokep.png')3534 } catch (e) {3535 console.log(e)3536 res.sendFile(error)3537 }3538})35393540router.get('/googleimage', async (req, res, next) => {3541 var q = req.query.q,3542 apikeyInput = req.query.apikey;35433544 if(!apikeyInput) return res.json(loghandler.notparam)3545 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3546 if (!q) return res.json(loghandler.notquery)35473548 try {3549 var json = await (await fetch(`https://api.fdci.se/rep.php?gambar=${q}`)).json()3550 var body = JSON.parse(JSON.stringify(json))3551 var tada = body[Math.floor(Math.random() * body.length)]3552 var hasil = await getBuffer(tada)3553 await fs.writeFileSync(__path + '/tmp/image.png', hasil)35543555 res.sendFile(__path + '/tmp/image.png')3556 } catch (e) {3557 console.log(e)3558 res.sendFile(error)3559 }3560})35613562router.get('/say', async (req, res, next) => {3563 var apikeyInput = req.query.apikey,3564 text = req.query.text;35653566 if(!apikeyInput) return res.json(loghandler.notparam)3567 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)35683569 res.json({3570 status : true,3571 creator : `${creator}`,3572 result : text3573 })3574})35753576router.get('/md5', async (req, res, next) => {3577 var apikeyInput = req.query.apikey,3578 text = req.query.text;35793580 if(!apikeyInput) return res.json(loghandler.notparam)3581 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3582 if (!text) return res.json(loghandler.nottext)35833584 var result = await createHash('md5').update(text).digest('hex')3585 res.json({3586 status : true,3587 creator : `${creator}`,3588 result : result3589 })3590})35913592router.get('/tahta', async (req, res, next) => {3593 var text = req.query.text,3594 apikeyInput = req.query.apikey;35953596 if(!apikeyInput) return res.json(loghandler.notparam)3597 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3598 if (!text) return res.json(loghandler.nottext)35993600 var hasil = await (await fetch(`https://api.zeks.xyz/api/hartatahta?text=${text}&apikey=apivinz`)).buffer()3601 await fs.writeFileSync(__path + '/tmp/tahta.png', hasil)36023603 res.sendFile(__path + '/tmp/tahta.png')3604})36053606router.get('/customtahta', async (req, res, next) => {3607 var text = req.query.text,3608 apikeyInput = req.query.apikey;36093610 if(!apikeyInput) return res.json(loghandler.notparam)3611 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3612 if (!text) return res.json(loghandler.nottext)36133614 var hasil = await (await fetch(`https://api.zeks.xyz/api/tahta?text=${text}&apikey=apivinz`)).buffer()3615 await fs.writeFileSync(__path + '/tmp/cstahta.png', hasil)36163617 res.sendFile(__path + '/tmp/cstahta.png')3618})36193620router.get('/anime/random', async (req, res, next) => {3621 var apikeyInput = req.query.apikey;36223623 if(!apikeyInput) return res.json(loghandler.notparam)3624 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)36253626 try {3627 var json = await (await fetch(`https://api.fdci.se/rep.php?gambar=anime`)).json()3628 var body = JSON.parse(JSON.stringify(json))3629 var tada = body[Math.floor(Math.random() * body.length)]3630 var hasil = await getBuffer(tada)3631 await fs.writeFileSync(__path + '/tmp/anime.png', hasil)36323633 res.sendFile(__path + '/tmp/anime.png')3634 } catch (e) {3635 console.log(e)3636 res.sendFile(error)3637 }3638})36393640router.get('/kpop/random', async (req, res, next) => {3641 var apikeyInput = req.query.apikey;36423643 if(!apikeyInput) return res.json(loghandler.notparam)3644 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)36453646 try {3647 var json = await (await fetch(`https://api.fdci.se/rep.php?gambar=kpop`)).json()3648 var body = JSON.parse(JSON.stringify(json))3649 var tada = body[Math.floor(Math.random() * body.length)]3650 var hasil = await getBuffer(tada)3651 await fs.writeFileSync(__path + '/tmp/kpop.png', hasil)36523653 res.sendFile(__path + '/tmp/kpop.png')3654 } catch (e) {3655 console.log(e)3656 res.sendFile(error)3657 }3658})36593660router.get('/random/manga', async (req, res, next) => {3661 var apikeyInput = req.query.apikey;36623663 if(!apikeyInput) return res.json(loghandler.notparam)3664 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)36653666 try {3667 var json = await (await fetch(`https://api.fdci.se/rep.php?gambar=manga`)).json()3668 var body = JSON.parse(JSON.stringify(json))3669 var tada = body[Math.floor(Math.random() * body.length)]3670 var hasil = await getBuffer(tada)3671 await fs.writeFileSync(__path + '/tmp/manga.png', hasil)36723673 res.sendFile(__path + '/tmp/manga.png')3674 } catch (e) {3675 console.log(e)3676 res.sendFile(error)3677 }3678})36793680router.get('/triggered', async (req, res, next) => {3681 var img = req.query.img,3682 apikeyInput = req.query.apikey;3683 3684 if(!apikeyInput) return res.json(loghandler.notparam)3685 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3686 if (!img) return res.json(loghandler.notimg)3687 if (!img.startsWith('http')) return res.json(loghandler.invalidLink)36883689 try {3690 var result = await imageToBase64(`http://zekais-api.herokuapp.com/trigger?url=${img}`)3691 var hasil = Buffer.from(result, 'base64')3692 await fs.writeFileSync(__path + '/tmp/trigger.gif', hasil)36933694 res.sendFile(__path + '/tmp/trigger.gif')3695 } catch (e) {3696 console.log(e)3697 res.sendFile(error)3698 }3699})37003701router.get('/emojitopng', async (req, res, next) => {3702 var apikeyInput = req.query.apikey,3703 emoji = req.query.emoji;37043705try {3706 if(!apikeyInput) return res.json(loghandler.notparam)3707 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3708 if (!emoji) return res.json(loghandler.notemoji)37093710 var hasil = await (await fetch(`https://api.zeks.xyz/api/emoji-image?apikey=apivinz&emoji=${encodeURIComponent(emoji)}`)).buffer()3711 await fs.writeFileSync(__path + '/tmp/emojitopng.png', hasil)37123713 res.sendFile(__path + '/tmp/emojitopng.png')3714} catch (e) {3715 console.log(e)3716 res.sendFile(error) }3717})37183719router.get('/brainly', async (req, res, next) => {3720 var apikeyInput = req.query.apikey,3721 text = req.query.text;37223723try {3724 if(!apikeyInput) return res.json(loghandler.notparam)3725 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3726 if (!text) return res.json(loghandler.nottext)37273728 var json = await (await fetch(`https://api.zeks.xyz/api/brainly?apikey=apivinz&q=${text}&count=5`)).json()3729 res.json(json)3730 3731} catch (e) {3732 console.log(e)3733 res.sendFile(error)3734 }3735})37363737router.get('/pantun', async (req, res, next) => {3738 var apikeyInput = req.query.apikey;37393740try {3741 if(!apikeyInput) return res.json(loghandler.notparam)3742 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)37433744 var json = await (await fetch(`https://api.zeks.xyz/api/pantun?apikey=apivinz`)).json()3745 res.json(json)37463747} catch (e) {3748 console.log(e)3749 res.sendFile(error)3750 }3751})37523753router.get('/memeindo', async (req, res, next) => {3754 var apikeyInput = req.query.apikey;37553756try {3757 if(!apikeyInput) return res.json(loghandler.notparam)3758 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)37593760 var json = await (await fetch(`https://api.zeks.xyz/api/memeindo?apikey=apivinz`)).json()3761 var hasil = await getBuffer(json.result)3762 await fs.writeFileSync(__path + '/tmp/memeindo.png', hasil)37633764 res.sendFile(__path + '/tmp/memeindo.png')3765} catch (e) {3766 console.log(e)3767 res.sendFile(error)3768 }3769}) 37703771router.get('/artinama', async (req, res, next) => {3772 var apikeyInput = req.query.apikey,3773 nama = req.query.nama;37743775try {3776 if(!apikeyInput) return res.json(loghandler.notparam)3777 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3778 if (!nama) return res.json(loghandler.notnama) 37793780 request.get({3781 headers: {'content-type' : 'application/x-www-form-urlencoded'},3782 url: 'http://www.primbon.com/arti_nama.php?nama1=' + nama + '&proses=+Submit%21+',3783 }, function(error, response, body){3784 let $ = cheerio.load(body);3785 var y = $.html().split('arti:')[1];3786 var t = y.split('method="get">')[1];3787 var f = y.replace(t ," ");3788 var x = f.replace(/<br\s*[\/]?>/gi, "\n");3789 var h = x.replace(/<[^>]*>?/gm, '');37903791var result = `Arti dari namamu adalah\n\nNama *${nama}*\n${h}`3792 res.json({3793 status : true,3794 creator : `${creator}`,3795 result : result3796 })3797 })37983799} catch (e) {3800 console.log(e)3801 res.sendFile(error)3802 }3803})38043805router.get('/cekjodoh', async (req, res, next) => {3806 var apikeyInput = req.query.apikey,3807 nama = req.query.nama,3808 pasangan = req.query.pasangan;38093810try {3811 if(!apikeyInput) return res.json(loghandler.notparam)3812 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3813 if (!nama) return res.json(loghandler.notnama)3814 if (!pasangan) return res.json({ message : `Masukan nama pacarmu,, ehh pasangan :v` })38153816 request.get({3817 headers: {'content-type' : 'application/x-www-form-urlencoded'},3818 url: 'http://www.primbon.com/kecocokan_nama_pasangan.php?nama1=' + nama + '&nama2='+ pasangan +'&proses=+Submit%21+',38193820 }, function(error, response, body){3821 let $ = cheerio.load(body);3822 var y = $.html().split('<b>KECOCOKAN JODOH BERDASARKAN NAMA PASANGAN</b><br><br>')[1];3823 var t = y.split('.<br><br>')[1];3824 var f = y.replace(t ," ");3825 var x = f.replace(/<br\s*[\/]?>/gi, "\n");3826 var h = x.replace(/<[^>]*>?/gm, '');3827 var d = h.replace("&", '&')38283829var result = `Kecocokan Berdasarkan Nama :\n\n${d}`3830 res.json({3831 status : true,3832 creator : `${creator}`,3833 result : result3834 })3835 })38363837} catch (e) {3838 console.log(e)3839 res.sendFile(error)3840 }3841})38423843router.get('/kuis/caklontong', async (req, res, next) => {3844 var apikeyInput = req.query.apikey3845 3846 if(!apikeyInput) return res.json(loghandler.notparam)3847 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)38483849 fetch(encodeURI(`https://api-yogipw.herokuapp.com/api/kuis/caklontong?apikey=yogipw`))3850 .then(response => response.json())3851 .then(data => {3852 var result = data;3853 res.json({3854 author: 'ZeroYT7',3855 result3856 })3857 })3858 .catch(e => {3859 res.sendFile(error)3860})3861})38623863router.get('/asupan', async (req, res, next) => {3864 var apikeyInput = req.query.apikey;38653866try {3867 if(!apikeyInput) return res.json(loghandler.notparam)3868 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)38693870 var json = await (await fetch(`http://zekais-api.herokuapp.com/ptlvid`)).json()3871 res.json(json)38723873} catch (e) {3874 console.log(e)3875 res.sendFile(error)3876 }3877})38783879router.get('/cerpen', async (req, res, next) => {3880 var apikeyInput = req.query.apikey;38813882try {3883 if(!apikeyInput) return res.json(loghandler.notparam)3884 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)38853886 var json = await (await fetch(`http://zekais-api.herokuapp.com/cerpen`)).json()3887 res.json({3888 status : true,3889 creator : creator,3890 judul : json.title,3891 pengarang : json.pengarang,3892 kategori : json.category,3893 cerpen : json.post3894 })38953896} catch (e) {3897 console.log(e)3898 res.sendFile(error)3899 }3900})39013902router.get('/mediafire', async (req, res, next) => {3903 var apikeyInput = req.query.apikey,3904 url = req.query.url;39053906try {3907 if(!apikeyInput) return res.json(loghandler.notparam)3908 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3909 if (!url) return res.json(loghandler.noturl)3910 if (!url.startsWith('http')) return res.json(loghandler.invalidLink)39113912 var json = await (await fetch(`https://api.zeks.xyz/api/mediafire?apikey=apivinz&url=${url}`)).json()3913 res.json(json)39143915} catch (e) {3916 console.log(e)3917 res.sendFile(error)3918 }3919})39203921router.get('/tts', async (req, res, next) => {3922 var text = req.query.text,3923 lang = req.query.lang,3924 apikeyInput = req.query.apikey;39253926 if(!apikeyInput) return res.json(loghandler.notparam)3927 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3928 if (!text) return res.json(loghandler.nottext)3929 if (!lang) return res.json(loghandler.notlang)3930 if (lang > 4) return res.json({ error : `Kode bahasa tidak valid!` })39313932 try {3933 var ress = await imageToBase64(`http://zekais-api.herokuapp.com/speech?lang=${lang}&text=${text}`)3934 var tts = Buffer.from(ress, 'base64')3935 await fs.writeFileSync(__path + '/tmp/tts.opus', tts)39363937 res.sendFile(__path + '/tmp/tts.opus')3938 } catch (e) {3939 console.log(e)3940 res.sendFile(error)3941 }3942})39433944router.get('/darkjokes', async (req, res, next) => {3945 var apikeyInput = req.query.apikey;39463947try {3948 if(!apikeyInput) return res.json(loghandler.notparam)3949 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)39503951 var json = await (await fetch(`https://api.zeks.xyz/api/darkjokes?apikey=apivinz`)).json()3952 var hasil = await getBuffer(json.result)3953 await fs.writeFileSync(__path + '/tmp/darkjokes.png', hasil)39543955 res.sendFile(__path + '/tmp/darkjokes.png')3956} catch (e) {3957 console.log(e)3958 res.sendFile(error)3959 }3960})39613962router.get('/splaybutton', async (req, res, next) => {3963 var apikeyInput = req.query.apikey,3964 text = req.query.text;39653966try {3967 if(!apikeyInput) return res.json(loghandler.notparam)3968 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3969 if (!text) return res.json(loghandler.nottext)39703971 var hasil = await getBuffer(`https://api.zeks.xyz/api/splaybutton?text=${text}&apikey=apivinz`)3972 await fs.writeFileSync(__path + '/tmp/playbutton.png', hasil)39733974 res.sendFile(__path + '/tmp/playbutton.png')3975} catch (e) {3976 console.log(e)3977 res.sendFile(error)3978 }3979})39803981router.get('/gplaybutton', async (req, res, next) => {3982 var apikeyInput = req.query.apikey,3983 text = req.query.text;39843985try {3986 if(!apikeyInput) return res.json(loghandler.notparam)3987 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)3988 if (!text) return res.json(loghandler.nottext)39893990 var hasil = await getBuffer(`https://api.zeks.xyz/api/gplaybutton?text=${text}&apikey=apivinz`)3991 await fs.writeFileSync(__path + '/tmp/playbutton2.png', hasil)39923993 res.sendFile(__path + '/tmp/playbutton2.png')3994} catch (e) {3995 console.log(e)3996 res.sendFile(error)3997 }3998})39994000router.get('/textpantai', async (req, res, next) => {4001 var apikeyInput = req.query.apikey,4002 text = req.query.text;40034004try {4005 if(!apikeyInput) return res.json(loghandler.notparam)4006 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4007 if (!text) return res.json(loghandler.nottext)40084009 var hasil = await getBuffer(`https://api.zeks.xyz/api/sandw?apikey=apivinz&text=${text}`)4010 await fs.writeFileSync(__path + '/tmp/pantai.png', hasil)40114012 res.sendFile(__path + '/tmp/pantai.png')4013} catch (e) {4014 console.log(e)4015 res.sendFile(error)4016 }4017})40184019router.get('/textsalju', async (req, res, next) => {4020 var apikeyInput = req.query.apikey,4021 t1 = req.query.t1,4022 t2 = req.query.t2;40234024try {4025 if(!apikeyInput) return res.json(loghandler.notparam)4026 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4027 if (!t1) return res.json(loghandler.nottext)4028 if (!t2) return res.json(loghandler.nottext2)40294030 var json = await (await fetch(`https://api.zeks.xyz/api/snowwrite?text1=${t1}&text2=${t2}&apikey=apivinz`)).json()4031 await fs.writeFileSync(__path + '/tmp/salju.png', await getBuffer(json.result))40324033 res.sendFile(__path + '/tmp/salju.png')4034} catch (e) {4035 console.log(e)4036 res.sendFile(error)4037 }4038})40394040router.get('/alay', async (req, res, next) => {4041 var kata = req.query.kata,4042 apikeyInput = req.query.apikey;40434044try {4045 if(!apikeyInput) return res.json(loghandler.notparam)4046 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4047 if (!kata) return res.json(loghandler.notkata)4048 var json = await (await fetch(`https://api.terhambar.com/bpk?kata=${kata}`)).json()4049 res.json({4050 status : true,4051 creator : creator,4052 result : json.text4053 })40544055} catch (e) {4056 console.log(e)4057 res.sendFile(error)4058 }4059})40604061router.get('/firework', async (req, res, next) => {4062 var apikeyInput = req.query.apikey,4063 text = req.query.text;40644065try {4066 if(!apikeyInput) return res.json(loghandler.notparam)4067 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4068 if (!text) return res.json(loghandler.nottext)40694070 var hasil = await getBuffer(`https://api.zeks.xyz/api/tfire?text=${text}&apikey=apivinz`)4071 await fs.writeFileSync(__path + '/tmp/firework.png', hasil)40724073 res.sendFile(__path + '/tmp/firework.png')4074} catch (e) {4075 console.log(e)4076 res.sendFile(error)4077 }4078})40794080router.get('/retro', async (req, res, next) => {4081 var apikeyInput = req.query.apikey,4082 t1 = req.query.t1,4083 t2 = req.query.t2,4084 t3 = req.query.t3;40854086try {4087 if(!apikeyInput) return res.json(loghandler.notparam)4088 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4089 if (!t1) return res.json(loghandler.nottext)4090 if (!t2) return res.json(loghandler.nottext2)4091 if (!t3) return res.json(loghandler.nottext3)40924093 var json = await (await fetch(`https://api.zeks.xyz/api/retro?text1=${t1}&text2=${t2}&text3=${t3}&apikey=apivinz`)).json()4094 await fs.writeFileSync(__path + '/tmp/retro.png', await getBuffer(json.result))40954096 res.sendFile(__path + '/tmp/retro.png')4097} catch (e) {4098 console.log(e)4099 res.sendFile(error)4100 }4101})41024103router.get('/matrix', async (req, res, next) => {4104 var apikeyInput = req.query.apikey,4105 text = req.query.text;41064107try {4108 if(!apikeyInput) return res.json(loghandler.notparam)4109 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4110 if (!text) return res.json(loghandler.nottext)41114112 var hasil = await getBuffer(`https://api.zeks.xyz/api/matrix?apikey=apivinz&text=${text}`)4113 await fs.writeFileSync(__path + '/tmp/matrix.png', hasil)41144115 res.sendFile(__path + '/tmp/matrix.png')4116} catch (e) {4117 console.log(e)4118 res.sendFile(error)4119 }4120})41214122router.get('/text3d', async (req, res, next) => {4123 var apikeyInput = req.query.apikey,4124 text = req.query.text;41254126try {4127 if(!apikeyInput) return res.json(loghandler.notparam)4128 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4129 if (!text) return res.json(loghandler.nottext)41304131 var hasil = await getBuffer(`https://api.zeks.xyz/api/text3dbox?apikey=apivinz&text=${text}`)4132 await fs.writeFileSync(__path + '/tmp/3d.png', hasil)41334134 res.sendFile(__path + '/tmp/3d.png')4135} catch (e) {4136 console.log(e)4137 res.sendFile(error)4138 }4139})41404141router.get('/kuis/family100', async (req, res, next) => {4142 var apikeyInput = req.query.apikey41434144 if(!apikeyInput) return res.json(loghandler.notparam)4145 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)41464147 fetch(encodeURI(`https://raw.githubusercontent.com/reyhangans/Zhirrr-Api/main/lib/family100.json`))4148 .then(response => response.json())4149 .then(data => {4150 var result = data;4151 res.json({4152 result 4153 })4154 })4155 .catch(e => {4156 res.json(loghandler.error)4157})4158})41594160router.get('/pornlogo', async (req, res, next) => {4161 var apikeyInput = req.query.apikey,4162 t1 = req.query.t1,4163 t2 = req.query.t2;41644165try {4166 if(!apikeyInput) return res.json(loghandler.notparam)4167 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4168 if (!t1) return res.json(loghandler.nottext)4169 if (!t2) return res.json(loghandler.nottext2)41704171 var hasil = await getBuffer(`https://api.zeks.xyz/api/phlogo?text1=${t1}&text2=${t2}&apikey=apivinz`)4172 await fs.writeFileSync(__path + '/tmp/pornhub.png', hasil)41734174 res.sendFile(__path + '/tmp/pornhub.png')4175} catch (e) {4176 console.log(e)4177 res.sendFile(error)4178 }4179})41804181router.get('/marvel', async (req, res, next) => {4182 var apikeyInput = req.query.apikey,4183 t1 = req.query.t1,4184 t2 = req.query.t2;4185try {4186 if(!apikeyInput) return res.json(loghandler.notparam)4187 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4188 if (!t1) return res.json(loghandler.nottext)4189 if (!t2) return res.json(loghandler.nottext2)41904191 var hasil = await getBuffer(`https://api.zeks.xyz/api/marvellogo?text1=${t1}&text2=${t2}&apikey=apivinz`)4192 await fs.writeFileSync(__path + '/tmp/marvel.png', hasil)41934194 res.sendFile(__path + '/tmp/marvel.png')4195} catch (e) {4196 console.log(e)4197 res.sendFile(error)4198 }4199})42004201router.get('/blackpink', async (req, res, next) => {4202 var apikeyInput = req.query.apikey,4203 text = req.query.text;42044205try {4206 if(!apikeyInput) return res.json(loghandler.notparam)4207 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4208 if (!text) return res.json(loghandler.nottext)42094210 var hasil = await getBuffer(`https://api.zeks.xyz/api/logobp?text=${text}&apikey=apivinz`)4211 await fs.writeFileSync(__path + '/tmp/bp.png', hasil)42124213 res.sendFile(__path + '/tmp/bp.png')4214} catch (e) {4215 console.log(e)4216 res.sendFile(error)4217 }4218})42194220router.get('/avengers', async (req, res, next) => {4221 var apikeyInput = req.query.apikey,4222 t1 = req.query.t1,4223 t2 = req.query.t2;4224try {4225 if(!apikeyInput) return res.json(loghandler.notparam)4226 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4227 if (!t1) return res.json(loghandler.nottext)4228 if (!t2) return res.json(loghandler.nottext2)42294230 var hasil = await getBuffer(`https://api.zeks.xyz/api/logoaveng?text1=${t1}&text2=${t2}&apikey=apivinz`)4231 await fs.writeFileSync(__path + '/tmp/avenger.png', hasil)42324233 res.sendFile(__path + '/tmp/avenger.png')4234} catch (e) {4235 console.log(e)4236 res.sendFile(error)4237 }4238})42394240router.get('/thunder', async (req, res, next) => {4241 var apikeyInput = req.query.apikey,4242 text = req.query.text;42434244try {4245 if(!apikeyInput) return res.json(loghandler.notparam)4246 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4247 if (!text) return res.json(loghandler.nottext)42484249 var hasil = await getBuffer(`https://api.zeks.xyz/api/thundertext?text=${text}&apikey=apivinz`)4250 await fs.writeFileSync(__path + '/tmp/thunder.png', hasil)42514252 res.sendFile(__path + '/tmp/thunder.png')4253} catch (e) {4254 console.log(e)4255 res.sendFile(error)4256 }4257})42584259router.get('/news', async (req, res) => {4260 var apikeyInput = req.query.apikey;42614262 if(!apikeyInput) return res.json(loghandler.notparam)4263 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)42644265 var data = fs.readFileSync(__path + '/lib/utils/news.js')4266 var json = JSON.parse(data)42674268 res.json(json)4269})42704271router.get('/ssweb', async (req, res, next) => {4272 var apikeyInput = req.query.apikey,4273 url = req.query.url;42744275try {4276 if(!apikeyInput) return res.json(loghandler.notparam)4277 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4278 if (!url) return res.json(loghandler.noturl)4279 if (!url.startsWith('http')) return res.json(loghandler.invalidLink)42804281 var hasil = await getBuffer(`http://nurutomo.herokuapp.com/api/ssweb?url=${url}`)4282 await fs.writeFileSync(__path + '/tmp/screenshot.png', hasil)42834284 res.sendFile(__path + '/tmp/screenshot.png')4285} catch (e) {4286 console.log(e)4287 res.sendFile(error)4288 }4289})42904291router.get('/calculator', async (req, res) => {4292 var angka = req.query.angka,4293 apikeyInput = req.query.apikey;42944295 if(!apikeyInput) return res.json(loghandler.notparam)4296 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4297 if (!angka) return res.json(loghanlder.notangka)42984299 var val = angka4300 .replace(/[^0-9\-\/+*Ã÷ÏEe()piPI/]/g, '')4301 .replace(/Ã/g, '*')4302 .replace(/÷/g, '/')4303 .replace(/Ï|pi/gi, 'Math.PI')4304 .replace(/e/gi, 'Math.E')4305 .replace(/\/+/g, '/')4306 .replace(/\++/g, '+')4307 .replace(/-+/g, '-')4308 var format = val4309 .replace(/Math\.PI/g, 'Ï')4310 .replace(/Math\.E/g, 'e')4311 .replace(/\//g, '÷')4312 .replace(/\*Ã/g, 'Ã')4313 try {4314 console.log(val)4315 var result = (new Function('return ' + val))()4316 if (!result) res.json({ message : result })43174318 res.json({4319 status : true,4320 creator : creator,4321 result : result4322 })4323 } catch (e) {4324 if (e == undefined) res.json({ error : `Kesalahan Terjadi!` })4325 res.json({ message : `Format salah, hanya 0-9 dan Simbol -, +, *, /, Ã, ÷, Ï, e, (, ) yang disupport` })4326 }4327})43284329router.get('/hd', async (req, res) => {4330 var img = req.query.img,4331 apikeyInput = req.query.apikey;43324333 if(!apikeyInput) return res.json(loghandler.notparam)4334 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4335 if (!img) return res.json(loghandler.notimg)4336 if (!img.startsWith('http')) return res.json(loghandler.invalidLink)43374338try {4339 var media = await getBuffer(img)4340 var body = new FormData4341 body.append('image', media, 'image')4342 var ress = await fetch('http://max-image-resolution-enhancer.codait-prod-41208c73af8fca213512856c7a09db52-0000.us-east.containers.appdomain.cloud/model/predict', {4343 method: 'POST',4344 body4345 })4346 if (ress.status !== 200) return await res.json(ress)4347 await fs.writeFileSync(__path + '/tmp/hd.png', await ress.buffer())43484349 res.sendFile(__path + '/tmp/hd.png')4350 } catch (e) {4351 console.log(e)4352 res.sendFile(error)4353 }4354})43554356router.get('/dare', async (req, res, next) => {4357 var apikeyInput = req.query.apikey;43584359try {4360 if(!apikeyInput) return res.json(loghandler.notparam)4361 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)43624363 var json = await (await fetch(`https://xptnbotapinew.herokuapp.com/?dare&apikey=xptn`)).json()43644365 res.json({4366 status : true,4367 creator : creator,4368 result : json.Dare4369 })4370} catch (e) {4371 console.log(e)4372 res.sendFile(error)4373 }4374})43754376router.get('/quotemaker', async (req, res, next) => {4377 var quote = req.query.quote,4378 author = req.query.author,4379 theme = req.query.theme,4380 apikeyInput = req.query.apikey;43814382try {4383 if(!apikeyInput) return res.json(loghandler.notparam)4384 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4385 if (!quote) return res.json({ message : `Masukan parameter quote (kata quotes)` })4386 if (!author) return res.json({ message : `Masukan parameter author` })4387 if (!theme) return res.json(loghandler.nottheme)43884389 var json = await (await fetch(`https://terhambar.com/aw/qts/?kata=${quote}&author=${author}&tipe=${theme}`)).json()4390 await fs.writeFileSync(__path + '/tmp/quotemaker.png', await getBuffer(json.result))43914392 res.sendFile(__path + '/tmp/quotemaker.png')4393} catch (e) {4394 console.log(e)4395 res.sendFile(error)4396 }4397})43984399router.get('/attp', async (req, res, next) => {4400 var text = req.query.text,4401 apikeyInput = req.query.apikey;4402 4403 if(!apikeyInput) return res.json(loghandler.notparam)4404 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4405 if (!text) return res.json(loghandler.nottext)44064407 try {4408 var result = await imageToBase64(`https://api.xteam.xyz/attp?file&text=${text}`)4409 var hasil = Buffer.from(result, 'base64')4410 await fs.writeFileSync(__path + '/tmp/attp.webp', hasil)44114412 res.sendFile(__path + '/tmp/attp.webp')4413 } catch (e) {4414 console.log(e)4415 res.sendFile(error)4416 }4417})44184419router.get('/ttp2', async (req, res, next) => {4420 var text = req.query.text,4421 apikeyInput = req.query.apikey;4422 4423 if(!apikeyInput) return res.json(loghandler.notparam)4424 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4425 if (!text) return res.json(loghandler.nottext)44264427 try {4428 var result = await imageToBase64(`https://api.xteam.xyz/ttp?file&text=${text}`)4429 var hasil = Buffer.from(result, 'base64')4430 await fs.writeFileSync(__path + '/tmp/ttp.webp', hasil)44314432 res.sendFile(__path + '/tmp/ttp.webp')4433 } catch (e) {4434 console.log(e)4435 res.sendFile(error)4436 }4437})44384439router.get('/futureneon', async (req, res, next) => {4440 var text = req.query.text,4441 apikeyInput = req.query.apikey;4442 4443 if(!apikeyInput) return res.json(loghandler.notparam)4444 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4445 if (!text) return res.json(loghandler.nottext)44464447 try {4448 request.post({4449 url: "https://textpro.me/create-a-futuristic-technology-neon-light-text-effect-1006.html",4450 headers: {4451 'Content-Type': 'application/x-www-form-urlencoded'4452 },4453 body: `text_1=${text}&login=OK`,4454 }, (e,r,b) => {4455 if (!e) {4456 var $ = cheerio.load(b)4457 $('.thumbnail').find('img').each(function() {4458 h = $(this).attr("src")4459 var result = 'https://textpro.me/save-images/'+h4460 fetch(encodeURI(`https://api.imgbb.com/1/upload?expiration=120&key=93f5c8966cfaf3ca19051ee9f85c14f3&image=${result}&name=${randomTextNumber}`))4461 .then(response => response.json())4462 .then(data => {4463 res.json({4464 status: true,4465 creator : creator,4466 result : data.data.url4467 })4468 })4469 })4470 }4471 })4472 } catch (e) {4473 console.log(e);4474 res.sendFile(error)4475 }4476})44774478router.get('/spotify', async (req, res, next) => {4479 var apikeyInput = req.query.apikey,4480 q = req.query.q;44814482try {4483 if(!apikeyInput) return res.json(loghandler.notparam)4484 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4485 if (!q) return res.json(loghandler.notquery)44864487 var json = await (await fetch(`https://api.zeks.xyz/api/spotify?apikey=apivinz&q=${q}`)).json()44884489 res.json(json)4490} catch (e) {4491 console.log(e)4492 res.sendFile(error)4493 }4494})44954496router.get('/instagram', async (req, res, next) => {4497 var apikeyInput = req.query.apikey,4498 url = req.query.url;44994500try {4501 if(!apikeyInput) return res.json(loghandler.notparam)4502 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4503 if (!url) return res.json(loghandler.noturl)4504 if (!url.startsWith('http')) return res.json(logahndler.invalidLink)45054506 var json = await (await fetch(`https://api-anoncybfakeplayer.herokuapp.com/igdown?url=${url}`)).json()45074508 res.json(json)4509} catch (e) {4510 console.log(e)4511 res.sendFile(error)4512 }4513})45144515router.get('/towebp', async (req, res, next) => {4516 var apikeyInput = req.query.apikey,4517 url = req.query.url;45184519try {4520 if(!apikeyInput) return res.json(loghandler.notparam)4521 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4522 if (!url) return res.json(loghandler.noturl)4523 if (!url.startsWith('http')) return res.json(logahndler.invalidLink)45244525 var json = await (await fetch(`http://zekais-api.herokuapp.com/pngtowebp?url=${url}`)).json()45264527 res.json({4528 status : true,4529 creator : creator,4530 result : json.result4531 })4532} catch (e) {4533 console.log(e)4534 res.sendFile(error)4535 }4536})45374538router.get('/math', async (req, res, next) => {4539 var apikeyInput = req.query.apikey,4540 mode = req.query.mode;45414542try {4543 if(!apikeyInput) return res.json(loghandler.notparam)4544 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4545 if (!mode) return res.json({ message : `Silahkan masukan modenya,, Mode tersedia : 1. very_easy, 2. easy, 3. medium, 4. hard, 5. extreme, 6. impossible` })45464547 var json = await (await fetch(`http://zekais-api.herokuapp.com/math?mode=${mode}`)).json()45484549 res.json({4550 status : true,4551 creator : creator,4552 info : json.message,4553 soal : json.soal,4554 jawaban : json.jawaban,4555 poin : 250004556 })4557} catch (e) {4558 console.log(e)4559 res.sendFile(error)4560 }4561})45624563router.get('/math2', async (req, res, next) => {4564 var apikeyInput = req.query.apikey;45654566try {4567 if(!apikeyInput) return res.json(loghandler.notparam)4568 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)45694570 var json = await (await fetch(`https://salism3api.pythonanywhere.com/math`)).json()45714572 res.json({4573 status : true,4574 creator : creator,4575 soal : json.image,4576 jawaban : json.answer,4577 poin : 500004578 })4579} catch (e) {4580 console.log(e)4581 res.sendFile(error)4582 }4583})45844585router.get('/toimg', async (req, res, next) => {4586 var webp = req.query.webp,4587 apikeyInput = req.query.apikey;45884589try {4590 if(!apikeyInput) return res.json(loghandler.notparam)4591 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4592 if (!webp) return res.json(loghandler.notimg)4593 if (!webp.startsWith('http')) return res.json(loghandler.invalidLink)45944595 var img = await getBuffer(webp)4596 var bufs = []4597 var im = spawn('convert', ['webp:-', 'png:-'])4598 im.on('error',e => res.sendFile(error))4599 im.stdout.on('data', chunk => bufs.push(chunk))4600 im.stdin.write(img)4601 im.stdin.end()4602 im.on('exit', () => {4603 var encmedia = imageToBase64(Buffer.concat(bufs))4604 var media = Buffer.from(encmedia, 'base64')4605 fs.writeFileSync(__path + '/tmp/toimg.png', media)46064607 res.sendFile(__path + '/tmp/toimg.png')4608 })4609} catch (e) {4610 console.log(e)4611 res.sendFile(error)4612 }4613})46144615router.get('/qrcode', async (req, res, next) => {4616 var text = req.query.text,4617 apikeyInput = req.query.apikey;46184619try {4620 if(!apikeyInput) return res.json(loghandler.notparam)4621 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4622 if (!text) return res.json(loghandler.nottext)46234624 var qr = await qrcode.toDataURL(text.slice(0, 2048), { scale: 8 })4625 var hasil = qr.split`,`[1]4626 await fs.writeFileSync(__path + '/tmp/qr.png', hasil, 'base64')4627 res.sendFile(__path + '/tmp/qr.png')4628} catch (e) {4629 console.log(e)4630 res.sendFile(error)4631 }4632})46334634router.get('/imgbb', async (req, res, next) => {4635 var url = req.query.url,4636 apikeyInput = req.query.apikey;46374638try {4639 if(!apikeyInput) return res.json(loghandler.notparam)4640 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4641 if (!url) return res.json(loghandler.noturl)4642 if (!url.startsWith('http')) return res.json(loghandler.invalidLink)46434644 var json = await (await fetch(`https://api.imgbb.com/1/upload?expiration=180&key=761ea2d5575581057a799d14e9c78e28&image=${url}&name=imgbb-uploader`)).json()46454646 res.json({4647 status : true,4648 creator : creator,4649 info : 'url otomatis akan hilang dalam 3 menit',4650 url : json.data.url_viewer,4651 display_url : json.data.url,4652 delete_url : json.data.delete_url4653 })4654} catch (e) {4655 console.log(e)4656 res.sendFile(error)4657 }4658})46594660router.get('/createcode', async (req, res, next) => {4661 var text = req.query.text,4662 apikeyInput = req.query.apikey;46634664try {4665 if(!apikeyInput) return res.json(loghandler.notparam)4666 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4667 if (!text) return res.json(loghandler.nottext)46684669 var len = 254670 var arr = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ9876543210'4671 var random = ''4672 var random2 = ''46734674 for (var i = len; i > 0; i--) {4675 random += arr[Math.floor(Math.random() * arr.length)];4676 }4677 var lenn = 104678 var code = '';4679 for (var i = lenn; i > 0; i--) {4680 random2 += arr[Math.floor(Math.random() * arr.length)];4681 }4682 var encode = random + random2 + code46834684 res.json({4685 status : true,4686 creator : creator,4687 text : text,4688 code : encode4689 })4690} catch (e) {4691 console.log(e)4692 res.sendFile(error)4693 }4694})46954696router.get('/bucin', async (req, res, next) => {4697 apikeyInput = req.query.apikey;46984699try {4700 if(!apikeyInput) return res.json(loghandler.notparam)4701 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)47024703 var json = await (await fetch(`http://zekais-api.herokuapp.com/bucin`)).json()47044705 res.json({4706 status : true,4707 creator : creator,4708 bucin : json.result4709 })4710} catch (e) {4711 console.log(e)4712 res.sendFile(error)4713 }4714})47154716router.get('/memegen', async (req, res, next) => {4717 var img = req.query.img,4718 t1 = req.query.t1,4719 t2 = req.query.t2;4720 apikeyInput = req.query.apikey;47214722try {4723 if(!apikeyInput) return res.json(loghandler.notparam)4724 if(apikeyInput !== `${key}`) return res.sendFile(invalidKey)4725 if(!img) return res.json(loghandler.notimg)4726 if(!t1) return res.json(loghandler.nottext)4727 if(!t2) return res.json(loghandler.nottext2)4728 if (!img.startsWith('http')) return res.json(loghandler.invalidLink)47294730 var hasil = await (await fetch(`http://zekais-api.herokuapp.com/mgen?text1=${t1}&text2=${t2}&url=${img}`)).buffer()4731 await fs.writeFileSync(__path + '/tmp/memegen.png', hasil)47324733 res.sendFile(__path + '/tmp/memegen.png')4734 4735} catch (e) {4736 console.log(e)4737 res.sendFile(error)4738 }4739})474047414742// End of script
...
test_sendfile.py
Source:test_sendfile.py
1"""Tests for sendfile functionality."""2import asyncio3import os4import socket5import sys6import tempfile7import unittest8from asyncio import base_events9from asyncio import constants10from unittest import mock11from test import support12from test.test_asyncio import utils as test_utils13try:14 import ssl15except ImportError:16 ssl = None17def tearDownModule():18 asyncio.set_event_loop_policy(None)19class MySendfileProto(asyncio.Protocol):20 def __init__(self, loop=None, close_after=0):21 self.transport = None22 self.state = 'INITIAL'23 self.nbytes = 024 if loop is not None:25 self.connected = loop.create_future()26 self.done = loop.create_future()27 self.data = bytearray()28 self.close_after = close_after29 def connection_made(self, transport):30 self.transport = transport31 assert self.state == 'INITIAL', self.state32 self.state = 'CONNECTED'33 if self.connected:34 self.connected.set_result(None)35 def eof_received(self):36 assert self.state == 'CONNECTED', self.state37 self.state = 'EOF'38 def connection_lost(self, exc):39 assert self.state in ('CONNECTED', 'EOF'), self.state40 self.state = 'CLOSED'41 if self.done:42 self.done.set_result(None)43 def data_received(self, data):44 assert self.state == 'CONNECTED', self.state45 self.nbytes += len(data)46 self.data.extend(data)47 super().data_received(data)48 if self.close_after and self.nbytes >= self.close_after:49 self.transport.close()50class MyProto(asyncio.Protocol):51 def __init__(self, loop):52 self.started = False53 self.closed = False54 self.data = bytearray()55 self.fut = loop.create_future()56 self.transport = None57 def connection_made(self, transport):58 self.started = True59 self.transport = transport60 def data_received(self, data):61 self.data.extend(data)62 def connection_lost(self, exc):63 self.closed = True64 self.fut.set_result(None)65 async def wait_closed(self):66 await self.fut67class SendfileBase:68 # 128 KiB plus small unaligned to buffer chunk69 DATA = b"SendfileBaseData" * (1024 * 8 + 1)70 # Reduce socket buffer size to test on relative small data sets.71 BUF_SIZE = 4 * 1024 # 4 KiB72 def create_event_loop(self):73 raise NotImplementedError74 @classmethod75 def setUpClass(cls):76 with open(support.TESTFN, 'wb') as fp:77 fp.write(cls.DATA)78 super().setUpClass()79 @classmethod80 def tearDownClass(cls):81 support.unlink(support.TESTFN)82 super().tearDownClass()83 def setUp(self):84 self.file = open(support.TESTFN, 'rb')85 self.addCleanup(self.file.close)86 self.loop = self.create_event_loop()87 self.set_event_loop(self.loop)88 super().setUp()89 def tearDown(self):90 # just in case if we have transport close callbacks91 if not self.loop.is_closed():92 test_utils.run_briefly(self.loop)93 self.doCleanups()94 support.gc_collect()95 super().tearDown()96 def run_loop(self, coro):97 return self.loop.run_until_complete(coro)98class SockSendfileMixin(SendfileBase):99 @classmethod100 def setUpClass(cls):101 cls.__old_bufsize = constants.SENDFILE_FALLBACK_READBUFFER_SIZE102 constants.SENDFILE_FALLBACK_READBUFFER_SIZE = 1024 * 16103 super().setUpClass()104 @classmethod105 def tearDownClass(cls):106 constants.SENDFILE_FALLBACK_READBUFFER_SIZE = cls.__old_bufsize107 super().tearDownClass()108 def make_socket(self, cleanup=True):109 sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)110 sock.setblocking(False)111 if cleanup:112 self.addCleanup(sock.close)113 return sock114 def reduce_receive_buffer_size(self, sock):115 # Reduce receive socket buffer size to test on relative116 # small data sets.117 sock.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, self.BUF_SIZE)118 def reduce_send_buffer_size(self, sock, transport=None):119 # Reduce send socket buffer size to test on relative small data sets.120 # On macOS, SO_SNDBUF is reset by connect(). So this method121 # should be called after the socket is connected.122 sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.BUF_SIZE)123 if transport is not None:124 transport.set_write_buffer_limits(high=self.BUF_SIZE)125 def prepare_socksendfile(self):126 proto = MyProto(self.loop)127 port = support.find_unused_port()128 srv_sock = self.make_socket(cleanup=False)129 srv_sock.bind((support.HOST, port))130 server = self.run_loop(self.loop.create_server(131 lambda: proto, sock=srv_sock))132 self.reduce_receive_buffer_size(srv_sock)133 sock = self.make_socket()134 self.run_loop(self.loop.sock_connect(sock, ('127.0.0.1', port)))135 self.reduce_send_buffer_size(sock)136 def cleanup():137 if proto.transport is not None:138 # can be None if the task was cancelled before139 # connection_made callback140 proto.transport.close()141 self.run_loop(proto.wait_closed())142 server.close()143 self.run_loop(server.wait_closed())144 self.addCleanup(cleanup)145 return sock, proto146 def test_sock_sendfile_success(self):147 sock, proto = self.prepare_socksendfile()148 ret = self.run_loop(self.loop.sock_sendfile(sock, self.file))149 sock.close()150 self.run_loop(proto.wait_closed())151 self.assertEqual(ret, len(self.DATA))152 self.assertEqual(proto.data, self.DATA)153 self.assertEqual(self.file.tell(), len(self.DATA))154 def test_sock_sendfile_with_offset_and_count(self):155 sock, proto = self.prepare_socksendfile()156 ret = self.run_loop(self.loop.sock_sendfile(sock, self.file,157 1000, 2000))158 sock.close()159 self.run_loop(proto.wait_closed())160 self.assertEqual(proto.data, self.DATA[1000:3000])161 self.assertEqual(self.file.tell(), 3000)162 self.assertEqual(ret, 2000)163 def test_sock_sendfile_zero_size(self):164 sock, proto = self.prepare_socksendfile()165 with tempfile.TemporaryFile() as f:166 ret = self.run_loop(self.loop.sock_sendfile(sock, f,167 0, None))168 sock.close()169 self.run_loop(proto.wait_closed())170 self.assertEqual(ret, 0)171 self.assertEqual(self.file.tell(), 0)172 def test_sock_sendfile_mix_with_regular_send(self):173 buf = b"mix_regular_send" * (4 * 1024) # 64 KiB174 sock, proto = self.prepare_socksendfile()175 self.run_loop(self.loop.sock_sendall(sock, buf))176 ret = self.run_loop(self.loop.sock_sendfile(sock, self.file))177 self.run_loop(self.loop.sock_sendall(sock, buf))178 sock.close()179 self.run_loop(proto.wait_closed())180 self.assertEqual(ret, len(self.DATA))181 expected = buf + self.DATA + buf182 self.assertEqual(proto.data, expected)183 self.assertEqual(self.file.tell(), len(self.DATA))184class SendfileMixin(SendfileBase):185 # Note: sendfile via SSL transport is equal to sendfile fallback186 def prepare_sendfile(self, *, is_ssl=False, close_after=0):187 port = support.find_unused_port()188 srv_proto = MySendfileProto(loop=self.loop,189 close_after=close_after)190 if is_ssl:191 if not ssl:192 self.skipTest("No ssl module")193 srv_ctx = test_utils.simple_server_sslcontext()194 cli_ctx = test_utils.simple_client_sslcontext()195 else:196 srv_ctx = None197 cli_ctx = None198 srv_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)199 srv_sock.bind((support.HOST, port))200 server = self.run_loop(self.loop.create_server(201 lambda: srv_proto, sock=srv_sock, ssl=srv_ctx))202 self.reduce_receive_buffer_size(srv_sock)203 if is_ssl:204 server_hostname = support.HOST205 else:206 server_hostname = None207 cli_sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)208 cli_sock.connect((support.HOST, port))209 cli_proto = MySendfileProto(loop=self.loop)210 tr, pr = self.run_loop(self.loop.create_connection(211 lambda: cli_proto, sock=cli_sock,212 ssl=cli_ctx, server_hostname=server_hostname))213 self.reduce_send_buffer_size(cli_sock, transport=tr)214 def cleanup():215 srv_proto.transport.close()216 cli_proto.transport.close()217 self.run_loop(srv_proto.done)218 self.run_loop(cli_proto.done)219 server.close()220 self.run_loop(server.wait_closed())221 self.addCleanup(cleanup)222 return srv_proto, cli_proto223 @unittest.skipIf(sys.platform == 'win32', "UDP sockets are not supported")224 def test_sendfile_not_supported(self):225 tr, pr = self.run_loop(226 self.loop.create_datagram_endpoint(227 asyncio.DatagramProtocol,228 family=socket.AF_INET))229 try:230 with self.assertRaisesRegex(RuntimeError, "not supported"):231 self.run_loop(232 self.loop.sendfile(tr, self.file))233 self.assertEqual(0, self.file.tell())234 finally:235 # don't use self.addCleanup because it produces resource warning236 tr.close()237 def test_sendfile(self):238 srv_proto, cli_proto = self.prepare_sendfile()239 ret = self.run_loop(240 self.loop.sendfile(cli_proto.transport, self.file))241 cli_proto.transport.close()242 self.run_loop(srv_proto.done)243 self.assertEqual(ret, len(self.DATA))244 self.assertEqual(srv_proto.nbytes, len(self.DATA))245 self.assertEqual(srv_proto.data, self.DATA)246 self.assertEqual(self.file.tell(), len(self.DATA))247 def test_sendfile_force_fallback(self):248 srv_proto, cli_proto = self.prepare_sendfile()249 def sendfile_native(transp, file, offset, count):250 # to raise SendfileNotAvailableError251 return base_events.BaseEventLoop._sendfile_native(252 self.loop, transp, file, offset, count)253 self.loop._sendfile_native = sendfile_native254 ret = self.run_loop(255 self.loop.sendfile(cli_proto.transport, self.file))256 cli_proto.transport.close()257 self.run_loop(srv_proto.done)258 self.assertEqual(ret, len(self.DATA))259 self.assertEqual(srv_proto.nbytes, len(self.DATA))260 self.assertEqual(srv_proto.data, self.DATA)261 self.assertEqual(self.file.tell(), len(self.DATA))262 def test_sendfile_force_unsupported_native(self):263 if sys.platform == 'win32':264 if isinstance(self.loop, asyncio.ProactorEventLoop):265 self.skipTest("Fails on proactor event loop")266 srv_proto, cli_proto = self.prepare_sendfile()267 def sendfile_native(transp, file, offset, count):268 # to raise SendfileNotAvailableError269 return base_events.BaseEventLoop._sendfile_native(270 self.loop, transp, file, offset, count)271 self.loop._sendfile_native = sendfile_native272 with self.assertRaisesRegex(asyncio.SendfileNotAvailableError,273 "not supported"):274 self.run_loop(275 self.loop.sendfile(cli_proto.transport, self.file,276 fallback=False))277 cli_proto.transport.close()278 self.run_loop(srv_proto.done)279 self.assertEqual(srv_proto.nbytes, 0)280 self.assertEqual(self.file.tell(), 0)281 def test_sendfile_ssl(self):282 srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True)283 ret = self.run_loop(284 self.loop.sendfile(cli_proto.transport, self.file))285 cli_proto.transport.close()286 self.run_loop(srv_proto.done)287 self.assertEqual(ret, len(self.DATA))288 self.assertEqual(srv_proto.nbytes, len(self.DATA))289 self.assertEqual(srv_proto.data, self.DATA)290 self.assertEqual(self.file.tell(), len(self.DATA))291 def test_sendfile_for_closing_transp(self):292 srv_proto, cli_proto = self.prepare_sendfile()293 cli_proto.transport.close()294 with self.assertRaisesRegex(RuntimeError, "is closing"):295 self.run_loop(self.loop.sendfile(cli_proto.transport, self.file))296 self.run_loop(srv_proto.done)297 self.assertEqual(srv_proto.nbytes, 0)298 self.assertEqual(self.file.tell(), 0)299 def test_sendfile_pre_and_post_data(self):300 srv_proto, cli_proto = self.prepare_sendfile()301 PREFIX = b'PREFIX__' * 1024 # 8 KiB302 SUFFIX = b'--SUFFIX' * 1024 # 8 KiB303 cli_proto.transport.write(PREFIX)304 ret = self.run_loop(305 self.loop.sendfile(cli_proto.transport, self.file))306 cli_proto.transport.write(SUFFIX)307 cli_proto.transport.close()308 self.run_loop(srv_proto.done)309 self.assertEqual(ret, len(self.DATA))310 self.assertEqual(srv_proto.data, PREFIX + self.DATA + SUFFIX)311 self.assertEqual(self.file.tell(), len(self.DATA))312 def test_sendfile_ssl_pre_and_post_data(self):313 srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True)314 PREFIX = b'zxcvbnm' * 1024315 SUFFIX = b'0987654321' * 1024316 cli_proto.transport.write(PREFIX)317 ret = self.run_loop(318 self.loop.sendfile(cli_proto.transport, self.file))319 cli_proto.transport.write(SUFFIX)320 cli_proto.transport.close()321 self.run_loop(srv_proto.done)322 self.assertEqual(ret, len(self.DATA))323 self.assertEqual(srv_proto.data, PREFIX + self.DATA + SUFFIX)324 self.assertEqual(self.file.tell(), len(self.DATA))325 def test_sendfile_partial(self):326 srv_proto, cli_proto = self.prepare_sendfile()327 ret = self.run_loop(328 self.loop.sendfile(cli_proto.transport, self.file, 1000, 100))329 cli_proto.transport.close()330 self.run_loop(srv_proto.done)331 self.assertEqual(ret, 100)332 self.assertEqual(srv_proto.nbytes, 100)333 self.assertEqual(srv_proto.data, self.DATA[1000:1100])334 self.assertEqual(self.file.tell(), 1100)335 def test_sendfile_ssl_partial(self):336 srv_proto, cli_proto = self.prepare_sendfile(is_ssl=True)337 ret = self.run_loop(338 self.loop.sendfile(cli_proto.transport, self.file, 1000, 100))339 cli_proto.transport.close()340 self.run_loop(srv_proto.done)341 self.assertEqual(ret, 100)342 self.assertEqual(srv_proto.nbytes, 100)343 self.assertEqual(srv_proto.data, self.DATA[1000:1100])344 self.assertEqual(self.file.tell(), 1100)345 def test_sendfile_close_peer_after_receiving(self):346 srv_proto, cli_proto = self.prepare_sendfile(347 close_after=len(self.DATA))348 ret = self.run_loop(349 self.loop.sendfile(cli_proto.transport, self.file))350 cli_proto.transport.close()351 self.run_loop(srv_proto.done)352 self.assertEqual(ret, len(self.DATA))353 self.assertEqual(srv_proto.nbytes, len(self.DATA))354 self.assertEqual(srv_proto.data, self.DATA)355 self.assertEqual(self.file.tell(), len(self.DATA))356 def test_sendfile_ssl_close_peer_after_receiving(self):357 srv_proto, cli_proto = self.prepare_sendfile(358 is_ssl=True, close_after=len(self.DATA))359 ret = self.run_loop(360 self.loop.sendfile(cli_proto.transport, self.file))361 self.run_loop(srv_proto.done)362 self.assertEqual(ret, len(self.DATA))363 self.assertEqual(srv_proto.nbytes, len(self.DATA))364 self.assertEqual(srv_proto.data, self.DATA)365 self.assertEqual(self.file.tell(), len(self.DATA))366 def test_sendfile_close_peer_in_the_middle_of_receiving(self):367 srv_proto, cli_proto = self.prepare_sendfile(close_after=1024)368 with self.assertRaises(ConnectionError):369 self.run_loop(370 self.loop.sendfile(cli_proto.transport, self.file))371 self.run_loop(srv_proto.done)372 self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA),373 srv_proto.nbytes)374 self.assertTrue(1024 <= self.file.tell() < len(self.DATA),375 self.file.tell())376 self.assertTrue(cli_proto.transport.is_closing())377 def test_sendfile_fallback_close_peer_in_the_middle_of_receiving(self):378 def sendfile_native(transp, file, offset, count):379 # to raise SendfileNotAvailableError380 return base_events.BaseEventLoop._sendfile_native(381 self.loop, transp, file, offset, count)382 self.loop._sendfile_native = sendfile_native383 srv_proto, cli_proto = self.prepare_sendfile(close_after=1024)384 with self.assertRaises(ConnectionError):385 self.run_loop(386 self.loop.sendfile(cli_proto.transport, self.file))387 self.run_loop(srv_proto.done)388 self.assertTrue(1024 <= srv_proto.nbytes < len(self.DATA),389 srv_proto.nbytes)390 self.assertTrue(1024 <= self.file.tell() < len(self.DATA),391 self.file.tell())392 @unittest.skipIf(not hasattr(os, 'sendfile'),393 "Don't have native sendfile support")394 def test_sendfile_prevents_bare_write(self):395 srv_proto, cli_proto = self.prepare_sendfile()396 fut = self.loop.create_future()397 async def coro():398 fut.set_result(None)399 return await self.loop.sendfile(cli_proto.transport, self.file)400 t = self.loop.create_task(coro())401 self.run_loop(fut)402 with self.assertRaisesRegex(RuntimeError,403 "sendfile is in progress"):404 cli_proto.transport.write(b'data')405 ret = self.run_loop(t)406 self.assertEqual(ret, len(self.DATA))407 def test_sendfile_no_fallback_for_fallback_transport(self):408 transport = mock.Mock()409 transport.is_closing.side_effect = lambda: False410 transport._sendfile_compatible = constants._SendfileMode.FALLBACK411 with self.assertRaisesRegex(RuntimeError, 'fallback is disabled'):412 self.loop.run_until_complete(413 self.loop.sendfile(transport, None, fallback=False))414class SendfileTestsBase(SendfileMixin, SockSendfileMixin):415 pass416if sys.platform == 'win32':417 class SelectEventLoopTests(SendfileTestsBase,418 test_utils.TestCase):419 def create_event_loop(self):420 return asyncio.SelectorEventLoop()421 class ProactorEventLoopTests(SendfileTestsBase,422 test_utils.TestCase):423 def create_event_loop(self):424 return asyncio.ProactorEventLoop()425else:426 import selectors427 if hasattr(selectors, 'KqueueSelector'):428 class KqueueEventLoopTests(SendfileTestsBase,429 test_utils.TestCase):430 def create_event_loop(self):431 return asyncio.SelectorEventLoop(432 selectors.KqueueSelector())433 if hasattr(selectors, 'EpollSelector'):434 class EPollEventLoopTests(SendfileTestsBase,435 test_utils.TestCase):436 def create_event_loop(self):437 return asyncio.SelectorEventLoop(selectors.EpollSelector())438 if hasattr(selectors, 'PollSelector'):439 class PollEventLoopTests(SendfileTestsBase,440 test_utils.TestCase):441 def create_event_loop(self):442 return asyncio.SelectorEventLoop(selectors.PollSelector())443 # Should always exist.444 class SelectEventLoopTests(SendfileTestsBase,445 test_utils.TestCase):446 def create_event_loop(self):...
images.js
Source:images.js
...13//---------------------------\\14//Npc art\\15 //NPC 116 router.get('/npcFemalebakerUP', (req, res, next) =>{17 res.sendFile(NpcPath('npcFemalebakerUP.png'));18 });19 router.get('/npcFemalebakerSit', (req, res, next) =>{20 res.sendFile(NpcPath('npcFemalebakerSit.png'));21 });22 //NPC 223 router.get('/npcBusinessManUP', (req, res, next) =>{24 res.sendFile(NpcPath('Youngbusinessman4.png'));25 });26 router.get('/npcBusinessManSit', (req, res, next) =>{27 res.sendFile(NpcPath('Youngbusinessman1.png'));28 });29 //NPC 330 router.get('/npcOldBusinessManUP', (req, res, next) =>{31 res.sendFile(NpcPath('Oldbusinessman4.png'));32 });33 router.get('/npcOldBusinessManSit', (req, res, next) =>{34 res.sendFile(NpcPath('Oldbusinessman1.png'));35 });36 //NPC 437 router.get('/npcMaleStudentUP', (req, res, next) =>{38 res.sendFile(NpcPath('Malestudent4.png'));39 });40 router.get('/npcMaleStudentSit', (req, res, next) =>{41 res.sendFile(NpcPath('Malestudent1.png'));42 });43 //NPC 544 router.get('/npcMalePunktUP', (req, res, next) =>{45 res.sendFile(NpcPath('Malepunk4.png'));46 });47 router.get('/npcMalePunkSit', (req, res, next) =>{48 res.sendFile(NpcPath('Malepunk1.png'));49 });50 //NPC 651 router.get('/npcMaleCasualUP', (req, res, next) =>{52 res.sendFile(NpcPath('Malecasual4.png'));53 });54 router.get('/npcMaleCasualSit', (req, res, next) =>{55 res.sendFile(NpcPath('Malecasual1.png'));56 });57 //NPC 758 router.get('/npcFemaleYouthUP', (req, res, next) =>{59 res.sendFile(NpcPath('Femaleyouth4.png'));60 });61 router.get('/npcFemaleYouthSit', (req, res, next) =>{62 res.sendFile(NpcPath('Femaleyouth1.png'));63 });64 //NPC 865 router.get('/npcFemaleTrendyUP', (req, res, next) =>{66 res.sendFile(NpcPath('Femaletrendy4.png'));67 });68 router.get('/npcFemaleTrendySit', (req, res, next) =>{69 res.sendFile(NpcPath('Femaletrendy1.png'));70 });71 //NPC 972 router.get('/npcFemaleStudentUP', (req, res, next) =>{73 res.sendFile(NpcPath('Femalestudent4.png'));74 });75 router.get('/npcFemaleStudentSit', (req, res, next) =>{76 res.sendFile(NpcPath('Femalestudent1.png'));77 });78//--------\\79//Images\\80//UI81router.get('/CircleButtonInfo', (req, res, next) =>{82 res.sendFile(ImagesPathUI('CircleButtoInfo.png'));83});84router.get('/acceptbutton', (req, res, next) =>{85 res.sendFile(ImagesPathUI('DenyButton.png'));86});87router.get('/notificationFrame', (req, res, next) =>{88 res.sendFile(ImagesPathUI('NotificationFrame.png'));89});90router.get('/LoginSignupButton', (req, res, next) =>{91 res.sendFile(ImagesPathUI('LoginSignupButton.png'));92});93router.get('/ChatBalloon', (req, res, next) =>{94 res.sendFile(ImagesPathUI('ChatBalloon.png'));95});96router.get('/StorageFrame', (req, res, next) =>{97 res.sendFile(ImagesPathUI('StorageFrame.png'));98});99router.get('/SoundOn', (req, res, next) =>{100 res.sendFile(ImagesPathUI('SoundOn.png'));101});102router.get('/SoundOff', (req, res, next) =>{103 res.sendFile(ImagesPathUI('SoundOff.png'));104});105router.get('/Invisible', (req, res, next) =>{106 res.sendFile(ImagesPathUI('Invisible.png'));107});108router.get('/ConfigFrame', (req, res, next) =>{109 res.sendFile(ImagesPathUI('ConfigFrame.png'));110});111router.get('/LeaderboardTab', (req, res, next) =>{112 res.sendFile(ImagesPathUI('LeaderboardTab.png'));113});114router.get('/LeaderboardsFrame', (req, res, next) =>{115 res.sendFile(ImagesPathUI('LeaderboardsFrame.png'));116});117router.get('/MarketButton', (req, res, next) =>{118 res.sendFile(ImagesPathUI('MarketButton.png'));119});120router.get('/MarketFrame', (req, res, next) =>{121 res.sendFile(ImagesPathUI('MarketFrame.png'));122});123router.get('/CloseMarket', (req, res, next) =>{124 res.sendFile(ImagesPathUI('CloseMark.png'));125});126router.get('/JapanCityMarket', (req, res, next) =>{127 res.sendFile(ImagesPathUI('osakabutton.png'));128});129router.get('/JapanCityFriends', (req, res, next) =>{130 res.sendFile(ImagesPathUI('saporrobutton.png'));131});132router.get('/JapanCityRestaurant', (req, res, next) =>{133 res.sendFile(ImagesPathUI('tokyobutton.png'));134});135router.get('/JapanMap', (req, res, next)=>{136 res.sendFile(ImagesPathUI('JapanMap.png'));137});138router.get('/MoneyDisplayer', (req, res, next) =>{139 res.sendFile(ImagesPathUI('MoneyDisplayer.png'));140});141router.get('/levelstar', (req, res, next) =>{142 res.sendFile(ImagesPathUI('LevelStar.png'));143});144router.get('/LevelPortal', (req, res, next) =>{145 res.sendFile(ImagesPathUI('LevelPortal.png'));146});147router.get('/circlebutton', (req, res, next) =>{148 res.sendFile(ImagesPathUI('CircleButton.png'));149});150router.get('/CircleButtonCheck', (req, res, next) =>{151 res.sendFile(ImagesPathUI('CircleButtonCheck.png'));152});153router.get('/CircleButtonGeneral', (req, res, next) =>{154 res.sendFile(ImagesPathUI('CircleButtonGeneral.png'));155});156router.get('/CircleButtonGear', (req, res, next) =>{157 res.sendFile(ImagesPathUI('CircleButtonGear.png'));158});159router.get('/CircleButtonLogOut', (req, res, next) =>{160 res.sendFile(ImagesPathUI('CircleButtonLogOut.png'));161});162router.get('/CircleButtonLeaderboards', (req, res, next) =>{163 res.sendFile(ImagesPathUI('CircleButtonLeaderboards.png'));164});165router.get('/CircleButtonCooking', (req, res, next) =>{166 res.sendFile(ImagesPathUI('CircleButtonCooking.png'));167});168router.get('/CircleButtonDecoration', (req, res, next) =>{169 res.sendFile(ImagesPathUI('CircleButtonDecoration.png'));170});171router.get('/CircleButtonStorage', (req, res, next) =>{172 res.sendFile(ImagesPathUI('CircleButtonStorage.png'));173});174router.get('/CircleButtonMap', (req, res, next) =>{175 res.sendFile(ImagesPathUI('CircleButtonMap.png'));176});177router.get('/middleframe', (req, res, next) =>{178 res.sendFile(ImagesPathUI('MiddleFrame.png'));179});180router.get('/buttonImage', (req, res, next) =>{181 res.sendFile(ImagesPathUI('RectangleButton.png'));182});183router.get('/logo', (req, res, next) =>{184 res.sendFile(ImagesPathUI('LogoMomotaro.png'));185});186router.get('/lake', (req, res, next) =>{187 res.sendFile(ImagesPathUI('house.gif'));188});189router.get('/frame', (req, res, next) =>{190 res.sendFile(ImagesPathUI('frame.png'));191});192router.get('/ReturnButtonCook', (req, res, next) =>{193 res.sendFile(ImagesPathUI('Return_Restaurant.png'));194});195router.get('/floor_tile', (req, res, next) =>{196 res.sendFile(ImagesPathRes('WoodFloorTile.png'));197});198router.get('/wall_tile', (req, res, next) =>{199 res.sendFile(ImagesPathRes('BrickWallTile.png'));200});201router.get('/left_wall_tile', (req, res, next) =>{202 res.sendFile(ImagesPathRes('LeftSideWallTile.png'));203});204router.get('/right_wall_tile', (req, res, next) =>{205 res.sendFile(ImagesPathRes('RightSideWallTile.png'));206});207router.get('/right_corner_tile', (req, res, next) =>{208 res.sendFile(ImagesPathRes('RightCornerTile.png'));209});210router.get('/left_corner_tile', (req, res, next) =>{211 res.sendFile(ImagesPathRes('LeftCornerTile.png'));212});213router.get('/blue_wall_tile', (req, res, next) =>{214 res.sendFile(ImagesPathRes('BlueWallTile.png'));215});216router.get('/left_entrance_tile', (req, res, next) =>{217 res.sendFile(ImagesPathRes('EntranceLeftSideTile.png'));218});219router.get('/right_entrance_tile', (req, res, next) =>{220 res.sendFile(ImagesPathRes('EntranceRightSideTile.png'));221});222//UI\\223router.get('/bottom_frame', (req, res, next) => {224 res.sendFile(ImagesPathUI('BottomFrame.png'));225});226router.get('/left_yellow_arrow', (req, res, next) =>{227 res.sendFile(ImagesPathUI('LeftYellowArrow.png'));228});229router.get('/right_yellow_arrow', (req, res, next) =>{230 res.sendFile(ImagesPathUI('RightYellowArrow.png'));231});232//Decorations\\233router.get('/ChocolateFountain', (req, res, next) =>{234 res.sendFile(ImagesPathDec('Chocolate_Fountain.png'));235});236router.get('/Stanchion', (req, res, next) =>{237 res.sendFile(ImagesPathDec('Stanchion.png'));238});239router.get('/ChocolateHeart', (req, res, next) =>{240 res.sendFile(ImagesPathDec('Heart_chocolates.png'));241});242router.get('/Heater', (req, res, next) =>{243 res.sendFile(ImagesPathDec('Heater.png'));244});245router.get('/CardboxMaid', (req, res, next) =>{246 res.sendFile(ImagesPathDec('Cardbox_maid.png'));247});248router.get('/AnimatedCat', (req, res, next) =>{249 res.sendFile(ImagesPathDec('animated_cat.gif'));250});251router.get('/AnimatedCrow2', (req, res, next) =>{252 res.sendFile(ImagesPathDec('animated_crow2.gif'));253});254router.get('/AnimatedCrow', (req, res, next) =>{255 res.sendFile(ImagesPathDec('animated_crow.gif'));256});257router.get('/AnimatedPlant', (req, res, next) =>{258 res.sendFile(ImagesPathDec('Misc_pottedplant.gif'));259});260router.get('/Bar_Left', (req, res, next) =>{261 res.sendFile(ImagesPathDec('Bar_Left.png'));262});263router.get('/Bar_Middle', (req, res, next) =>{264 res.sendFile(ImagesPathDec('Bar_Middle.png'));265});266router.get('/Bar_Right', (req, res, next) =>{267 res.sendFile(ImagesPathDec('Bar_Right.png'));268});269router.get('/Beje_Plant', (req, res, next) =>{270 res.sendFile(ImagesPathDec('Beje_Plant.png'));271});272router.get('/Purple_Plant', (req, res, next) =>{273 res.sendFile(ImagesPathDec('Purple_Plant.png'));274});275router.get('/Chair_Back', (req, res, next) =>{276 res.sendFile(ImagesPathDec('Chair_Back.png'));277});278router.get('/Chair_Front', (req, res, next) =>{279 res.sendFile(ImagesPathDec('Chair_Front.png'));280});281router.get('/Cushion_Chair', (req, res, next) =>{282 res.sendFile(ImagesPathDec('Cushion_Chair.png'));283});284router.get('/Long_Table', (req, res, next) =>{285 res.sendFile(ImagesPathDec('Long_Table.png'));286});287router.get('/Simple_Table', (req, res, next) =>{288 res.sendFile(ImagesPathDec('Simple_Table.png'));289});290router.get('/Round_Table', (req, res, next) =>{291 res.sendFile(ImagesPathDec('Round_Table.png'));292});293router.get('/Machine_Karaoke', (req, res, next) =>{294 res.sendFile(ImagesPathDec('Machine_Karaoke.png'));295});296router.get('/Television', (req, res, next) =>{297 res.sendFile(ImagesPathDec('Television.png'));298});299router.get('/Television_Corner', (req, res, next) =>{300 res.sendFile(ImagesPathDec('Television_Corner.png'));301});302router.get('/Oven', (req, res, next) =>{303 res.sendFile(ImagesPathDec('Oven.png'));304});305//Igredients\\306router.get('/Tuna', (req, res, next) =>{307 res.sendFile(ImagesPathCooK('Tuna.png'));308});309router.get('/Shrimp', (req, res, next) =>{310 res.sendFile(ImagesPathCooK('Shrimp.png'));311});312router.get('/Cacoa', (req, res, next) =>{313 res.sendFile(ImagesPathCooK('Cacoa.png'));314});315router.get('/Cherry', (req, res, next) =>{316 res.sendFile(ImagesPathCooK('Cherry.png'));317});318router.get('/Eggs', (req, res, next) =>{319 res.sendFile(ImagesPathCooK('Eggs.png'));320});321router.get('/Pasta', (req, res, next) =>{322 res.sendFile(ImagesPathCooK('Pasta.png'));323});324router.get('/Tuna', (req, res, next) =>{325 res.sendFile(ImagesPathCooK('Tuna.png'));326});327router.get('/Rice', (req, res, next) =>{328 res.sendFile(ImagesPathCooK('Rice.png'));329});330router.get('/Water', (req, res, next) =>{331 res.sendFile(ImagesPathCooK('Water.png'));332});333router.get('/Oliva_Oil', (req, res, next) =>{334 res.sendFile(ImagesPathCooK('Oliva_Oil.png'));335});336router.get('/Bread', (req, res, next) =>{337 res.sendFile(ImagesPathCooK('Bread.png'));338});339router.get('/Tuna', (req, res, next) =>{340 res.sendFile(ImagesPathCooK('Tuna.png'));341});342router.get('/Flour', (req, res, next) =>{343 res.sendFile(ImagesPathCooK('Flour.png'));344});345router.get('/Noodles', (req, res, next) =>{346 res.sendFile(ImagesPathCooK('Noodles.png'));347});348router.get('/Bread_Omelet', (req, res, next) =>{349 res.sendFile(ImagesPathCooK('Bread_Omelet.png'));350});351router.get('/Tuna_Sushi', (req, res, next) =>{352 res.sendFile(ImagesPathCooK('Tuna_Sushi.png'));353});354router.get('/Shrimp_Sushi', (req, res, next) =>{355 res.sendFile(ImagesPathCooK('Shrimp_Sushi.png'));356});357router.get('/Chocolate_Cake', (req, res, next) =>{358 res.sendFile(ImagesPathCooK('Chocolate_Cake.png'));359});360router.get('/Cherry_Pie', (req, res, next) =>{361 res.sendFile(ImagesPathCooK('Cherry_Pie.png'));362});...
server.js
Source:server.js
...3var app = express();4var data_url = "http://data.c100.hasura.me";//"https://data.rishabapp.hasura-app.io"5var auth_url = "http://auth.c100.hasura.me";//"https://auth.rishabapp.hasura-app.io"6app.get('/', function (req, res) {7 res.sendFile(path.join(__dirname, 'ui', 'index.html'));8});9app.get('/main.js', function (req, res) {10 res.sendFile(path.join(__dirname, 'ui', 'main.js'));11});12app.get(auth_url+'/signup', function (req, res) {13 res.sendFile(path.join(__dirname, 'ui', 'try.html'));14});15app.get('/ann.html', function (req, res) {16 res.sendFile(path.join(__dirname, 'ui', 'ann.html'));17});18app.get('/diss.html', function (req, res) {19 res.sendFile(path.join(__dirname, 'ui', 'diss.html'));20});21app.get('/sem.html', function (req, res) {22 res.sendFile(path.join(__dirname, 'ui', 'sem.html'));23});24app.get('/css/creative.min.css', function (req, res) {25 res.sendFile(path.join(__dirname, 'ui/css', 'creative.min.css'))26});27app.get('/css/creative.css', function (req, res) {28 res.sendFile(path.join(__dirname, 'ui/css', 'creative.css'));29});30app.get('/vendor/bootstrap/css/bootstrap.min.css', function (req, res) {31 res.sendFile(path.join(__dirname, 'ui/vendor/bootstrap/css', 'bootstrap.min.css'));32});33app.get('/vendor/bootstrap/css/bootstrap.css', function (req, res) {34 res.sendFile(path.join(__dirname, 'ui/vendor/bootstrap/css', 'bootstrap.css'));35});36app.get('/vendor/font-awesome/css/font-awesome.min.css', function (req, res) {37 res.sendFile(path.join(__dirname, 'ui/vendor/font-awesome/css', 'font-awesome.min.css'));38});39app.get('/vendor/magnific-popup/magnific-popup.css', function (req, res) {40 res.sendFile(path.join(__dirname, 'ui/vendor/magnific-popup', 'magnific-popup.css'));41});42app.get('/vendor/jquery/jquery.min.js', function (req, res) {43 res.sendFile(path.join(__dirname, 'ui/vendor/jquery', 'jquery.min.js'));44});45app.get('/vendor/bootstrap/js/bootstrap.min.js', function (req, res) {46 res.sendFile(path.join(__dirname, 'ui/vendor/bootstrap/js', 'bootstrap.min.js'));47});48app.get('/vendor/scrollreveal/scrollreveal.min.js', function (req, res) {49 res.sendFile(path.join(__dirname, 'ui/vendor/scrollreveal', 'scrollreveal.min.js'));50});51app.get('/vendor/magnific-popup/jquery.magnific-popup.min.js', function (req, res) {52 res.sendFile(path.join(__dirname, 'ui/vendor/magnific-popup', 'jquery.magnific-popup.min.js'));53});54app.get('/js/creative.min.js', function (req, res) {55 res.sendFile(path.join(__dirname, 'ui/js', 'creative.min.js'));56});57app.get('/img/uni.jpg', function (req, res) {58 res.sendFile(path.join(__dirname, 'ui/img', 'uni.jpg'));59});60app.get('/img/header.jpg', function (req, res) {61 res.sendFile(path.join(__dirname, 'ui/img', 'header.jpg'));62});63app.get('/sign_in.html', function (req, res) {64 res.sendFile(path.join(__dirname, 'ui', 'sign_in.html'));65});66app.get('/register.html', function (req, res) {67 res.sendFile(path.join(__dirname, 'ui', 'register.html'));68});69var counter = 0;70app.get('/counter', function (req, res) {71 counter = counter + 1;72 res.send(counter.toString());73});74app.listen(8080, function () {75 console.log('Example app listening on port 8080!');...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!