import Pinterest from "pinterest-node-api";
const client = new Pinterest('pina_AMAS3KIWABUBCAA');
try {
// Search for pins with the keyword
const res = await client.request('/pins', {
method: 'GET',
params: {
query: `${keyword} ${modifier}`,
fields: 'id,note,image'
}
});
const pins = res.data;
// Comment on each pin
for await (const pin of pins) {
await client.comment(pin.id, variation);
console.log(`Commented on pin: https://pinterest.com/pin/${pin.id}`);
}
} catch (error) {
console.error(`Failed to search for or comment on pins. Error: ${error.message}`);
}
我得到client.request is not a function
我正试图执行一个API调用来搜索全球引脚的关键字。
他们页面上的文档没有给予我太多的信心,因为没有一个例子有效。
1条答案
按热度按时间ljsrvy3e1#