【发布时间】:2018-01-13 17:11:08
【问题描述】:
我正在尝试确定某条推文是原始推文还是转推。
我尝试使用retweeted_status,但即使状态为转推,它也不会出现在 JSON 中。
【问题讨论】:
-
在这里查看我的答案:stackoverflow.com/questions/47612822/… 我在其中创建了一个 pandas 数据框来存储 Twitter 数据。创建的列之一显示存储的推特是否为转发。
我正在尝试确定某条推文是原始推文还是转推。
我尝试使用retweeted_status,但即使状态为转推,它也不会出现在 JSON 中。
【问题讨论】:
如果推文是转推,则retweeted_status 的值将包含原始推文的 JSON 对象。
如果您正在使用 Retweet 对象,则该对象将包含两个 Tweet 对象,以及两个 User 对象。被转推的推文称为“原始”推文,并显示在“转推状态”键下。
同样来自here:
通过
retweeted_status属性的存在,可以将转推与典型推文区分开来。此属性包含被转发的原始推文的表示。
原始推文 JSON 对象骨架的示例(从上面的页面复制)(没有 retweeted_status 键):
{
"tweet": {
"user": {
...
},
"place": {
...
},
"entities": {
...
},
"extended_entities": {
...
}
}
}
转推 JSON 对象骨架示例(具有 retweeted_status 键):
{
"tweet": {
"user": {
},
"retweeted_status": {
"tweet": {
"user": {
},
"place": {
},
"entities": {
},
"extended_entities": {
}
},
},
"place": {
},
"entities": {
},
"extended_entities": {
}
}
}
【讨论】: