Rishikant181 / Rettiwt-API

A CLI tool and an API for fetching data from Twitter for free!
https://rishikant181.github.io/Rettiwt-API/
MIT License
309 stars 31 forks source link

rettiwt.tweet.search error #347

Closed rockie2695 closed 11 months ago

rockie2695 commented 11 months ago

error: TypeError: Cannot read properties of undefined (reading 'created_at') at new Tweet (/.../node_modules/rettiwt-api/dist/models/Tweet.js:65:39) at new CursoredData (/.../node_modules/rettiwt-api/dist/models/CursoredData.js:47:32) at TweetService.FetcherService.extractData (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:154:16) at TweetService.<anonymous> (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:174:37) at step (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:33:23) at Object.next (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:14:53) at fulfilled (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:5:58) at processTicksAndRejections (node:internal/process/task_queues:96:5) TypeError: Cannot read properties of undefined (reading 'created_at') at new Tweet (/.../node_modules/rettiwt-api/dist/models/Tweet.js:65:39) at new CursoredData (/.../node_modules/rettiwt-api/dist/models/CursoredData.js:47:32) at TweetService.FetcherService.extractData (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:154:16) at TweetService.<anonymous> (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:174:37) at step (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:33:23) at Object.next (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:14:53) at fulfilled (/.../node_modules/rettiwt-api/dist/services/FetcherService.js:5:58)

when tweet item is missing legacy: ... quoted_status_id_str: '1686935419059847168', quoted_status_permalink: { url: 'https://t.co/8hM0AJm0ac', expanded: 'https://twitter.com/revengers_mu/status/1686935419059847168', display: 'twitter.com/revengers_mu/s…' }, reply_count: 401, retweet_count: 804, retweeted: false, user_id_str: '896932241615355904', id_str: '1686949482137784320' } } { __typename: 'Tweet', rest_id: '1686935419059847168' }

Rishikant181 commented 11 months ago

Were you trying to fetch retweets?

rockie2695 commented 11 months ago

Were you trying to fetch retweets?

yes,

i call this: rettiwt.tweet.search({ fromUsers: [twitterUser.username], });

The result may contains retweets or quoted tweets.

Rishikant181 commented 11 months ago

Strange, it's working on my end though.

i call this: rettiwt.tweet.search({ fromUsers: [twitterUser.username], });

What's the username? I need that to reproduce the error.

rockie2695 commented 11 months ago

for example: await rettiwt.tweet.search({ fromUsers: ["saitou_kiara"], });

fetch stop after receive { __typename: 'Tweet', rest_id: '1686949482137784320', core: { user_results: { result: [Object] } }, edit_control: { edit_tweet_ids: [ '1686949482137784320' ], editable_until_msecs: '1691038673000', is_edit_eligible: true, edits_remaining: '5' }, is_translatable: true, views: { count: '635031', state: 'EnabledWithCount' }, source: '<a href="http://twitter.com/download/iphone" rel="nofollow">Twitter for iPhone</a>', quotedRefResult: { result: { __typename: 'Tweet', rest_id: '1686935419059847168' } }, legacy: { bookmark_count: 21, bookmarked: false, created_at: 'Thu Aug 03 03:57:53 +0000 2023', conversation_id_str: '1686949482137784320', display_text_range: [ 0, 101 ], entities: { user_mentions: [], urls: [], hashtags: [Array], symbols: [] }, favorite_count: 7343, favorited: false, full_text: 'ミュージカル「東京リベンジャーズ」\n' + '\n' + '橘 日向役で出演させていただきます!\n' + '\n' + '今からとても緊張してますが\n' + 'この素晴らしい作品に関わることができてすごく嬉しいです!\n' + '\n' + 'よろしくお願いします✨\n' + '\n' + '#リベミュ', is_quote_status: true, lang: 'ja', quote_count: 413, quoted_status_id_str: '1686935419059847168', quoted_status_permalink: { url: 'https://t.co/8hM0AJm0ac', expanded: 'https://twitter.com/revengers_mu/status/1686935419059847168', display: 'twitter.com/revengers_mu/s…' }, reply_count: 477, retweet_count: 1119, retweeted: false, user_id_str: '896932241615355904', id_str: '1686949482137784320' } } { __typename: 'Tweet', rest_id: '1686935419059847168' } { __typename: 'Tweet', rest_id: '1686935419059847168' }

Rishikant181 commented 11 months ago

Okay, found the culprit. It's an issue with the way the data is extracted from the raw data.

Patch will be coming in soon

rockie2695 commented 11 months ago

Okay, found the culprit. It's an issue with the way the data is extracted from the raw data.

Patch will be coming in soon

thx

Rishikant181 commented 11 months ago

@rockie2695 The issue has been fixed. Please update to version 2.0.1

jsonkcli commented 9 months ago

This issue is occurring again today Rish

error TypeError: Cannot read properties of undefined (reading 'created_at') at new Tweet (/Users/dev/purpleai/node_modules/rettiwt-api/src/models/Tweet.ts:76:33) at new CursoredData (/Users/dev/purpleai/node_modules/rettiwt-api/src/models/CursoredData.ts:34:20) at TweetService.FetcherService.extractData (/Users/dev/purpleai/node_modules/rettiwt-api/src/services/FetcherService.ts:185:10) at TweetService. (/Users/iandeeq/dev/purpleai/node_modules/rettiwt-api/src/services/FetcherService.ts:207:21) at step (/Users/dev/purpleai/node_modules/rettiwt-api/dist/services/FetcherService.js:33:23) at Object.next (/Users/dev/purpleai/node_modules/rettiwt-api/dist/services/FetcherService.js:14:53) at fulfilled (/Users/dev/purpleai/node_modules/rettiwt-api/dist/services/FetcherService.js:5:58)