JSFiddle - React, Tailwind, and code Playground
by Shirly Manor
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/PapaParse/4.5.0/papaparse.min.js">
</script>
<input type="text" id="myText"
value="https://tesla-cdn.thron.com/delivery/public/image/tesla/8236e3bd-0525-4210-b01e-80f847ba1e59/bvlatuR/std/2688x1100/careers-working"
size="70">
<p>Click the "Convert" button to get the Cloudinary URL.</p>
<button onclick="convertToCloudinary()">Convert</button>
<p id="demo"></p>
<p id="test"></p>
Thron:
<p id="thron"></p>
JavaScript
function convertToCloudinary(){
const csv = "https://res.cloudinary.com/shirly-dam/raw/upload/v1675292138/csvFile.csv";
let results = [];
const csvData = Papa.parse(csv, {
header: true,
download: true,
complete: response => {
results = response.data;
// You can access the data here
document.body.innerHTML += findEmailByName("8236e3bd-0525-4210-b01e-80f847ba1e59");
}
});
}
function findEmailByName(name) {
return results.filter(data => data.ID === name)[0].Public_Id;
}