Public
Script
Forked from gwoods22/sendNotification
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import axios from "npm:axios";
axios.defaults.headers.get["User-Agent"] =
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3";
async function run() {
const imageUrl =
"https://prodimage.images-bn.com/lf?set=key%5Bresolve.pixelRatio%5D,value%5B1%5D&set=key%5Bresolve.width%5D,value%5B600%5D&set=key%5Bresolve.height%5D,value%5B10000%5D&set=key%5Bresolve.imageFit%5D,value%5Bcontainerwidth%5D&set=key%5Bresolve.allowImage
console.log("ran");
try {
await axios.get(imageUrl, { responseType: "arraybuffer" });
console.log("ran axios");
} catch (error) {
console.error(error.response["data"]["errors"]);
throw error;
}
}
run();
// export default async () => {
// console.log("starting");
//
// };
Val Town is a social website to write and deploy JavaScript.
Build APIs and schedule functions from your browser.
Comments
Nobody has commented on this val yet: be the first!
July 3, 2024