kausha-mehta / php-twitter

Automatically exported from code.google.com/p/php-twitter
0 stars 0 forks source link

twitter::friendsTimeline #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I've done some work with twitter::friendsTimeline to get the actual friends
timeline. It's hackish and crude copy and paste coding but it does (mostly)
work with XML at any rate. However, there are some deep flaws not least of
which is the query string attachment seems to cause an error...

    /**
     * Send an authenticated request to Twitter for the timeline of
authenticating users friends. 
     * Returns the last 20 updates by default
     * @deprecated true
     * @param boolean|integer $id Specifies the ID or screen name of the user
for whom to return the friends_timeline. (set to false if you want to use
authenticated user).
     * @param boolean|integer $since Narrows the returned results to just
those statuses created after the specified date.
     * @return string
     */
    function friendsTimeline($since = false, $since_id = false, $count = 20,
$page = false) 
    //$id = false, $since = false, $since_id = false, $count = 20, $page = false )
    {
        if( !in_array( $this->type, array( 'xml','json','rss','atom' ) ) )
            return false;

        $args = array();
        if( $count )
        $args['count'] = (int) $count;
        if( $since )
        $args['since'] = (string) $since;
        if( $since_id )
        $args['since_id'] = (int) $since_id;
        if( $page )
        $args['page'] = (int) $page;

        $qs = '';
        if( !empty( $args ) )
        $qs = $this->_glue( $args );

            // when enabling . $qs; I seem to kill the results. 
            // So this solution is flawed.
            $request = 'http://twitter.com/statuses/friends_timeline/' .
rawurlencode($this->username) . '.' . $this->type ; //. $qs;

        return $this->objectify( $this->process($request) );
        //return $this->userTimeline( $id, $count, $since, $since_id, $page );
    }

Original issue reported on code.google.com by matt...@thanetstar.com on 24 Mar 2009 at 2:03

GoogleCodeExporter commented 8 years ago
according to twitter documentation, the friendsTimeline is the timeline of
authenticated user AND his/her friends. This is not what ver 1.1 api function 
does.
That function is meant to query any specific friend.

Original comment by paracha3 on 5 Apr 2009 at 6:33

GoogleCodeExporter commented 8 years ago
Hey Matt,

I appear to have somewhat duplicated your issue down at #31, have a look. I 
have the same issue - that the 
current implementation doesn't match the current API, or at least that its 
possible to request another user's 
timeline - but suggest a different solution. 

There's nothing wrong with your code, it just comes down to the parameters. If 
I might be so bold - you 
reused the code these guys had deprecated, whereas the API now has a different 
set of parameters. I figure 
these guys' deprecated code matches the way the API used to be, but I wasn't 
around back then.

I'm hoping Aaron and Keith don't stay away too long.

Cheers,
3Easy.

Original comment by three.e...@gmail.com on 14 May 2009 at 11:06

GoogleCodeExporter commented 8 years ago
Dupe #31

Original comment by emmenset...@gmail.com on 16 Jun 2009 at 5:50