status[0]->user[0]->screen_name; $totalStatus = count($simple_xml->status); for ($i = 0; $i < $totalStatus; $i++) { // Grab my twitter status $statuses = $simple_xml->status[$i]->text[0]; // The following is optional. It filters any @replies (since they are often irrelevant without context) if ($simple_xml->status[$i]->in_reply_to_screen_name[0] == "") { $refinedStatus[] = $statuses; } } if (is_array($refinedStatus)) { // Randomize the array if (shuffle($refinedStatus)) { $rndStatus = $refinedStatus[0]; $msg = $rndStatus." @".$username.""; $displayed = true; } else { $displayed = false; } } else { $displayed = false; } // This is the alternative quote to display if the above code does not work if ($displayed == false) { $msg = '"No one believes forecasts, but we all want to hear them." - Dilbert'; } return $msg; } ?>