views:

311

answers:

2

Hey guys, I'm using Twitter's PHP API, called twitterlibphp, and it works well, but there's one thing that I need to be able to initiate, which is the linking of URLs and @username replies. I already have the function for this written up correctly (it is called clickable_link($text);) and have tested it successfully. I am not too familiar with parts of twitterlibphp (link goes to source code), and I am not sure where to put the function clickable_link() in order to make URLs and @username's clickable. I hope that is enough information, thanks a lot.

EDIT: In addition, I would like only one status to come up in the function GetFriendsTimeline(), right now 20 come up, is there any easy way to limit it to one?

+1  A: 

You don't need to put clickable_link() in twitterlibphp. Instead, call it right before you output a status message. Example:

$twitter = new Twitter('username', 'password');
$result = $twitter->getUserTimeline();

... parse the $result XML here ...

echo 'Status : '.clickable_link($status);
jimyi
+2  A: 

I would extend the Twitter class and put the functionality in my own getUserTimeline method.

class MyTwitter extends Twitter
{
    public function getUserTimeline()
    {
        $result = parent::getUserTimeline();

        // Your functionality ...

        return $result;
    }
}
Philippe Gerber