Open zacharisharris opened 6 years ago
Twitter incorrectly returns "full_text" truncated to 140 characters on the retweet. To get the full text of the original tweet, look in the .retweeted_status.full_text
property.
I've made an example for you.
I use this function to get the complete final FULL text.
function getCompleteText(tweet) {
let result;
if (tweet.retweeted_status) {
if (tweet.retweeted_status.full_text) {
result = tweet.retweeted_status.full_text;
} else if (tweet.retweeted_status.extended_tweet) {
result = tweet.retweeted_status.extended_tweet.full_text;
} else {
result = tweet.text;
}
} else {
result = tweet.full_text || tweet.text;
}
return result;
}
function getCompleteText(tweet) {
let result;
if(tweet.extended_tweet) {
result = tweet.extended_tweet.full_text;
} else if (tweet.retweeted_status) {
if (tweet.retweeted_status.full_text) {
result = tweet.retweeted_status.full_text;
} else if (tweet.retweeted_status.extended_tweet) {
result = tweet.retweeted_status.extended_tweet.full_text;
} else {
result = tweet.text;
}
} else {
result = tweet.full_text || tweet.text;
}
return result;
}
Own implementation... This works for me
I managed to get full_text(280) on simple tweets, but it doesn't work on retweets. Can someone tell me how I can get it to work?