Michael Waterfall
Michael Waterfall

Reputation: 20569

Twitter API method (statuses/user_timeline) returning all user data against every tweet?

Is it just me or is it ridiculous that when retrieving users statuses, every single tweet also contains the full information about the user? So if I want to retrieve 200 tweets from a single user, I will get the user information (name, profile colours, description, etc.) duplicated 200 times! The user information per tweet is probably 150% more data than the individual tweet data! That's a lot of wasted data to download on a mobile device!

Is there not some hidden parameter to not return user information?

Upvotes: 0

Views: 1689

Answers (3)

Thomas Upton
Thomas Upton

Reputation: 1899

According to the documentation, you can use the trim_user parameter to return a "trimmed" user object that contains only the user ID that is associated with the status.

An example using twurl:

$ twurl "/1/statuses/user_timeline.xml?count=200&trim_user=true"

That piece of information (the user object) is still going to be repeated many times, but it will take up a lot less space.

Upvotes: 2

Ryan Alford
Ryan Alford

Reputation: 7594

Most likely, it's for consistency.

Upvotes: 1

Jonathan Feinberg
Jonathan Feinberg

Reputation: 45324

Yes, it's ridiculous. It's also ridiculous that they don't document what encoding they use, and that they use lossy encoding to change angle-brackets into HTML entity codes, and that their JSON is poorly formed, and goodness knows what else. It's amateur hour!

Upvotes: 1

Related Questions