gpt4 book ai didi

javascript - 解析 Javascript 和 Twitter API

转载 作者:行者123 更新时间:2023-12-03 08:41:20 26 4
gpt4 key购买 nike

我正在运行 Parse 云代码,试图在网页上显示我的 Twitter feed。这是我在下面的 html 中的 javascript。

<script type="application/javascript">

Parse.initialize("my app id", "my javascript id");
enter code herevar Tweets = Parse.Object.extend("Tweets");
var query = new Parse.Query(Tweets);
query.find({
success: function(results) {
// results is an array of your Tweets
console.log(results);
},
error: function(error) {
alert("Error: " + error.code + " " + error.message);
}
});

</script>

这是 console.log 中的输出

[ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSub类,ParseObjectSubclass,ParseObjectSubclass,ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, Parse对象子类、解析对象子类、解析对象子类、解析对象子类、解析对象子类、 ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, ParseObjectSubclass, Parse对象子类、解析对象子类、解析对象子类、解析对象子类、解析对象子类、解析对象子类,解析对象子类,解析对象子类,解析对象子类]

它在我的 Parse 核心仪表板中显示为 77 条推文,因此云代码正在运行。

如何仅以干净可读的格式显示内容,即。 Twitter 头像、消息、时间等?

我尝试按照下面的教程进行操作,但没有帮助 https://medium.com/@nannerb/tutorial-storing-tweets-in-parse-via-the-twitter-api-9fe2ee092013

最佳答案

可能这些对象有一个 toString 方法,该方法将返回对象的名称,您可以迭代所有属性来检查它们:

success: function(results) {
for (var i = 0; i < results.length; i++) {
for (var prop in results[i]) {
console.log("Property name -> " . prop);
console.log("Property value -> " . results[i][prop]);
}
}
},

关于javascript - 解析 Javascript 和 Twitter API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33044858/

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