Rishikant181 / Rettiwt-API

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

specific tweet id gives undefined object #391

Closed banana-isad closed 11 months ago

banana-isad commented 11 months ago
const { Rettiwt } = require('rettiwt-api');

// Creating a new Rettiwt instance using the API_KEY
const rettiwt = new Rettiwt('key');

rettiwt.tweet.details('1500442270725599233')
.then(data => {
    console.log(data.tweetBy.userName);
});

i tried this exact code with multiple different tweet ids, it printed the username correctly, however, with this exact tweet id, which i know exists, it gives me undefined every single time

TypeError: Cannot read properties of undefined (reading 'tweetBy')
    at C:\dev\twtrt\index.js:8:19
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
Rishikant181 commented 11 months ago

Strange, judging by the raw response received from Twitter, this specific tweet has either been deleted or inaccessible.

Are you sure the tweet exists? Do you have a link to it?

banana-isad commented 11 months ago

the reason i say it exists, is because the image that it links is accessible, https://pbs.twimg.com/media/FNKkS6iUcAEwH_M?format=jpg&name=large you can get tweet id from image link like this in dev tools, as i have done for other images and it worked for those ids edit: wait, nvm i just checked and the tweet id is gone from the image

Rishikant181 commented 11 months ago

Yeah, the tweet has been removed, I guess.