Rails twitter gem list retrieve/display full tweet

image
ruby
display
api

#1

I am using the twitter gem and displaying the tweets from a public list but

  • when a tweet has an image the last part of the text of the tweet is truncated with …

How can I make the full tweet text display even if the image (or the link of the image) is not displayed?

I need the full text for each tweet in the list.

Here is how I am getting the tweets from the list:

list = URI.parse(‘https://twitter.com/USERNAME/LISTNAME’)
$client.list_timeline(list)


#2

Add the ?tweet_mode=extended parameter to the call to the list endpoint. If you’re accessing just the text of the Tweet to display it afterwards, you’ll need to look for the full_text field in the results.


#3

I am getting same results :frowning:

list = URI.parse(‘https://twitter.com/USERNAME/LISTNAME?tweet_mode=extended’)
$client.list_timeline(list)

when displaying: tweet.full_text


#4

Wait - you’re not using the API, it looks like you’re getting a web page?

You need to use the GET lists/statuses endpoint and use that parameter.

I just validated that this will work using twurl. Here’s an example of what that call looks like.

twurl "/1.1/lists/statuses.json?owner_screen_name=evilpiper&slug=mylist&tweet_mode=extended"

#5

I am getting an error:
[“errors”, [{“code”=>215, “message”=>“Bad Authentication data.”}]]

response = HTTParty.get(“https://api.twitter.com/1.1/lists/statuses.json?owner_screen_name=evilpiper&slug=mylist&tweet_mode=extended”)


#6

never mind got it.
response = $client.get(“https://api.twitter.com/1.1/lists/statuses.json?owner_screen_name=USERNAME&slug=LISTNAME&tweet_mode=extended”)

:+1: Thanks


#7