[英]User Mention Timeline Gives 0 Results With twitter-api-v2
Trying to use the user mention timeline via twitter-api-v2 and it always says there are no tweets mentioning the user, I've tested out many different user id's and they all give the same result.尝试通过 twitter-api-v2 使用用户提及时间线,它总是说没有提及用户的推文,我测试了许多不同的用户 ID,它们都给出了相同的结果。
_realData: { meta: { result_count: 0 } } _realData: { meta: { result_count: 0 } }
const getMentions = async () => {
try {
const mentions = await rwClient.v2.userMentionTimeline('141664648', { end_time: '2011-11-06T00:00:00-00:00' });
console.log(mentions);
} catch (e) {
console.error(e);
}
}
getMentions();
outputs产出
TweetUserMentionTimelineV2Paginator {
_maxResultsWhenFetchLast: 100,
_realData: { meta: { result_count: 0 } },
_rateLimit: { limit: 450, remaining: 449, reset: 1673495653 },
_instance: TwitterApiv2 {
_currentUser: null,
_currentUserV2: null,
_requestMaker: ClientRequestMaker {
rateLimits: [Object],
clientSettings: {},
bearerToken: '<my bearer token>'
},
_prefix: 'https://api.twitter.com/2/'
},
_queryParams: { end_time: '2011-11-06T00:00:00-00:00' },
_sharedParams: { id: '141664648' },
_endpoint: 'users/:id/mentions'
}
It works fine for userMentionTimeline()
in 'twitter-api-v2' It just hard to find a good time slot for user.它适用于“twitter-api-v2”中的
userMentionTimeline()
只是很难为用户找到一个好的时间段。
import { TwitterApi } from 'twitter-api-v2';
const getMentions = async () => {
try {
const twitterClient = new TwitterApi('**************************************');
const readOnlyClient = twitterClient.readOnly;
const mentions = await readOnlyClient.v2.userMentionTimeline('415859364', { start_time: '2023-01-12T05:12:01Z', end_time: '2023-01-12T05:20:01Z' });
return Promise.resolve(mentions.data);
} catch (error) {
return Promise.reject(error);
}
}
getMentions()
.then((result) => {
console.log(JSON.stringify(result, null, 4))
})
.catch(error => {
console.error(error);
});
The API and display time are different due to UTC (API time) and UTC+8 (tweet UI time) difference display but it is same if convert UTC+8 (display) to UTC (API). API 和显示时间因UTC(API 时间)和UTC+8(tweet UI 时间)差异显示而不同,但如果将UTC+8(显示)转换为UTC(API),则相同。
https://twitter.com/cielbleu011/status/1613405379060457472
https://twitter.com/cielbleu011/status/1613405151326527489
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.