我不知道为什么当我在 Node 上的 Twitter API get function() 中使用 tweet_mode='extended' 时会导致"未定义".js



我有几个问题。我想获得推特全文,所以我使用了 get(( 函数,但它在返回时被截断。喜欢这个:

'RT @Journeyto100k_: Google was not the first search engine, but quickly became the standard. Internet explorer even came preloaded on every…',
'RT @ApolloCurrency: Check out our latest blog post! In case you missed it.                          nn"Apollonauts Unveil Wiki…',

我使用 tweet_mode ='extended' 和 retweeted_status 来获取属性full_text但它没有用。

let keyword1 = T.get('search/tweets',  {
            q:  'Crypto Currency crypto currency since:2019-04-15', count: 100, request: tweet_mode='extended' },async function (err, data, response) {
            let addr;
            let text = data.statuses.map(retweeted_status=>retweeted_status.text);
            console.log(text);

我希望 get(( 结果的输出是全文,但实际输出是文本截断的。+ 在更多, data obejct 具有"全文"属性,但它返回截断的文本。喜欢这个:

{ created_at: 'Fri Apr 19 04:22:40 +0000 2019',
       id: 1119093934167212000,
       id_str: '1119093934167212032',
       full_text:
        'RT @Drife_official: DRIFE presented at Trybe’s first annual Endless Dappathonn @trybe_social n#cryptocurrency #drife…',
       truncated: false,
       display_text_range: [Array],
       entities: [Object],
       metadata: [Object],
       source:
        '<a href="http://twitter.com" rel="nofollow">Twitter Web Client</a>',
       in_reply_to_status_id: null,
       in_reply_to_status_id_str: null,
       in_reply_to_user_id: null,
       in_reply_to_user_id_str: null,
       in_reply_to_screen_name: null,
       user: [Object],
       geo: null,
       coordinates: null,
       place: null,
       contributors: null,
       retweeted_status: [Object],
       is_quote_status: false,
       retweet_count: 330,
       favorite_count: 0,
       favorited: false,
       retweeted: false,
       possibly_sensitive: false,
       lang: 'en' },

我找到了解决方案。

T.get('search/tweets', {
            q, count, tweet_mode: 'extended'},async function (err, data, response) {
            let text = data.statuses.map(status=>status.full_text);

我错过了full_text而不是text.

并且只有RT(retwitt)被截断。 另一个没有截断。

最新更新