This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getPreviousdate(date){ | |
const [day,month,year] = date.split('-'); | |
const today = new Date(year,month - 1,day) | |
const milliseconds = today.getTime() - 86400000 | |
const d2 = new Date(milliseconds); | |
const Previousdate = d2.toLocaleDateString(['ban', 'id']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FromData from 'form-data'; // form-data depcrecated use alternative, works for now | |
import fetch from 'node-fetch'; | |
import * as ft from 'file-type'; // for detecting extention of the file from the buffer | |
const url = 'https://i.waifu.pics/1y5O6HN.jpg'; // example link | |
const getbuffer = async (url)=> await fetch(url).then(x =>x.buffer()); | |
async function upload(){ |