This file contains hidden or 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
const axios = require('axios'); | |
const fs = require('fs'); | |
const headers = { 'x-vol-tenant': '5c49cda1ddca5800122fad4e' }; | |
const materialApi = 'https://api.material.com/images'; | |
const getImages = async (url, headers) => { | |
if (!fs.existsSync('404s.txt')) { | |
fs.writeFileSync('404s.txt', ''); | |
} | |
const params = { |
This file contains hidden or 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
const putS3StringObject = async (bucket, key, str) => { | |
try { | |
const s3 = new aws_sdk_1.S3(); | |
const buf = Buffer.from(str); | |
await s3.putObject({ | |
Key: key, | |
Bucket: bucket, | |
Body: buf, | |
ContentEncoding: 'base64' | |
}).promise(); |
OlderNewer