jdp / twitterlibphp

An object-oriented PHP interface to the Twitter API
http://jdp.github.com/twitterlibphp
MIT License
155 stars 34 forks source link

statuses/user_timeline for another user #2

Closed 3Easy closed 15 years ago

3Easy commented 15 years ago

Hello,

This is a potential issue with the implementation of the statuses/user_timeline method.

The API documentation suggests it is possible to request another user's timeline, using the id parameter. Using curl at the command line we succeeded with id, user_id and screen_name.

From looking at the code, function getUserTimeline() could only return recent status from the authenticating user, the way it is structured currently.

There is a slim chance we haven't passed the parameters in properly in our own code, we observe they are collected from an array in the function. But we don't have an example to follow.

Maybe you can set us straight, please.

Cheers, 3Easy.

jdp commented 15 years ago

I need to clear this up in the docs. The $options array in most of the methods basically gets transformed into the query string. If you want to access statuses/user_timeline.json?screen_name=3easy you would do this:

$twitter->getUserTimeline(array('screen_name'=>'3easy'))

It would also work with id and user_id.

Sorry for not making that clear in the docs.

Justin

3Easy commented 15 years ago

Thanks,

Makes sense of course, since "statuses/user_timeline/12345.xml" gets the same result as "statuses/user_timeline.xml?user_id=12345", right? (appears I spent too long in the code itself).

These docs of which you speak, where do they live? I poked around the generated documentation, but this doesn't touch on the use of the code. I suspect the general user would benefit greatly from some live examples.

Great Work, 3Easy.