我如何使用airtable和wordpress API下载图像,然后在JavaScript中上传到WordPress
我希望制作一个自动化脚本,该脚本从Airtable中获取图像并下载并将其上传到WordPress上传文件夹。这些图像应与我为它们创建的空图像字段对所有帖子类型进行回填。例如,我为自己为詹姆斯·少校(James Major)创作了个人资料,并且有一个图像字段,它应该拍摄那张照片并填写。我不知道从哪里开始,因为我是新手编码,而我正在即时学习。感谢您的帮助
enter code here
var base = new Airtable({ apiKey: 'API KEY HERE' }).base('Base key here');
const table = base('USERS');
const getRecords = async() => {
const records = await table.select({
maxRecords: 0,
view: "Website Export"
}).firstPage();
console.log(records);
};
getRecords();
const getRecordById = async(id) => {
try {
const record = await table.find(id);
console.log(record)
} catch (err) {
console.error(err);
}
};
// const createRecord
getRecordById(); ```
Im looking to make an automation script that takes images from Airtable and downloads and upload them to Wordpress upload folder. these images should backfill on all the post types with the empty image fields i have created for them. for example say i made a profile for myself James Major and there is an image field, it should take that pic and fill in it. i don't have a clue where to begin as I'm new to coding and i am learning on the fly. thank you for your help
enter code here
var base = new Airtable({ apiKey: 'API KEY HERE' }).base('Base key here');
const table = base('USERS');
const getRecords = async() => {
const records = await table.select({
maxRecords: 0,
view: "Website Export"
}).firstPage();
console.log(records);
};
getRecords();
const getRecordById = async(id) => {
try {
const record = await table.find(id);
console.log(record)
} catch (err) {
console.error(err);
}
};
// const createRecord
getRecordById(); ```
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论