$message = “your direct message”;
$t= new twitter();
$t->username= “yourtwitterusername”;
$t->password= “yourtwitterpassword”;
$res = $t->sendDirectMessage(“directmsgrecepient,$message);
if($res===false){ //if there is a Twitter error
echo ‘<span class=”style7”>Something went wrong!</span> <br/>Twitter said: <span class=”style5”>’ . $t->errmsg . ‘</span><br/> Please try again.’;
}else{
echo ‘<span class=”style3”>SUCCESS!! TWEET SENT!</span><br/>’;}
Writer. Musician. Adventurer. Nerd.
Purveyor of GIFs and dad jokes.