gpt4 book ai didi

node.js - 使用 Twit for Node 返回 OEMBED 对象而不是 undefined object

转载 作者:太空宇宙 更新时间:2023-11-04 01:05:18 31 4
gpt4 key购买 nike

所以我正在使用 Twit https://github.com/ttezel/twit对于 Node

我想从 twitter 1.1 api 获取 OEMBED 代码,但它似乎不起作用。

twit.get('statuses/oembed', { id: 133640144317198338 },  function (err, data, response) {
console.log(data);
console.log(err);

})

所以我一直收到未定义的返回信息,网址模式似乎是正确的,但我不知道为什么它不起作用。

这是记录的错误

{ [Error: Sorry, that page does not exist]
message: 'Sorry, that page does not exist',
statusCode: 404,
code: 34,
allErrors: [ { message: 'Sorry, that page does not exist', code: 34 } ],
twitterReply: '{"errors":[{"message":"Sorry, that page does not exist","code":34}]}' }

我能够检索雕像和几乎所有其他东西,但 oembed 不起作用。

任何帮助都会很棒

这里是 Twitter 的 OEMBED api 的链接 https://api.twitter.com/1.1/statuses/oembed.json?id=240192632003911681

最佳答案

在您的推文 ID 周围引用一些引号。我遇到这个问题是因为我输入的是状态的 id,而不是 id_str

关于node.js - 使用 Twit for Node 返回 OEMBED 对象而不是 undefined object ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23665022/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com