Where's the tweet id?

174 views
Skip to first unread message

fiskeben

unread,
Sep 27, 2010, 2:57:33 PM9/27/10
to Grackle Development
Hi,

I'm pretty new to this so please bear with me if this is a no-brainer,
but I can't seem to find the id of the tweet in the TweetStruct I get
in return? My query is tweets =
client.statuses.user_timeline.json :count => 1. I'm fetching my own
tweets so screen_name shouldn't be necessary (but I did try and add it
and it didn't help).

Am I using the wrong method? According to http://dev.twitter.com/doc/get/statuses/user_timeline
the guid should be part of the response.

Hayes Davis

unread,
Sep 27, 2010, 3:48:21 PM9/27/10
to Grackle Development
The id is accessible via

tweets[0].id

If you're doing this in irb, you won't see the id attribute displayed
in the output it shows after running that line but it's there. It's a
known issue with the inspect method on TwitterStruct that trips people
up - definitely not a no-brainer.

Hayes

On Sep 27, 11:57 am, fiskeben <fiske...@gmail.com> wrote:
> Hi,
>
> I'm pretty new to this so please bear with me if this is a no-brainer,
> but I can't seem to find the id of the tweet in the TweetStruct I get
> in return? My query is tweets =
> client.statuses.user_timeline.json :count => 1. I'm fetching my own
> tweets so screen_name shouldn't be necessary (but I did try and add it
> and it didn't help).
>
> Am I using the wrong method? According tohttp://dev.twitter.com/doc/get/statuses/user_timeline

fiskeben

unread,
Sep 27, 2010, 4:53:05 PM9/27/10
to Grackle Development
That worked perfectly, thanks a lot.

One could argue that I should have given `id´ a shot ;)

--
Ricco
Reply all
Reply to author
Forward
0 new messages