How to use Tuitter

Instance Tuitter object

Create Tuitter object to make Twitter client. Each object shows one Twitter account.

$account1 = new Tuitter('user1', 'passwd1');
$account2 = new Tuitter('user2', 'passwd2');

Get Tweets

Let us get Tweets from Twitter.

First, showing the home timeline onto standard output. Call Tuitter::getHomeTL to get home timeline.

$tuitter = new Tuitter($user, $passwd);
$tl = $tuitter->getHomeTL();
foreach($tl as $tweet){
  echo $tweet->user->screen_name.":\n";
  echo $tweet->text."\n\n";


Next, tweet on your account.

To send messages, using Tuitter::sendMessage method.

$tuitter = new Tuitter($user, $passwd);
$tuitter->sendMessage('This is the first tweet by Tuitter.');

See your timeline on browsers.

Manipulate Users

After getting followers (Tuitter::getFollowers), follow them if the follower is not followed by the account user.

$tuitter = new Tuitter($user, $passwd);
$followers = $tuitter->getFollowers();
foreach($followers as $follower){

In this case, $follower is Tuitter_User object.
You can manipulate this object. Following, unfollowing, sending direct messages, reply and so on.