I just read the a post dealing with Twitter, and thought I should add here the snippet that I made to display the last tweet a user has made.
The user has to have an unprotected account for this to work.
Snippet name: [[myLastTweet]]
Description: My last tweet.
[!myLastTweet? &username=`modxcms`!]
<?php
// Your twitter username.
isset($username) ? $username : $username = 'ICHCheezburger';
$feed = "http://search.twitter.com/search.atom?q=from:" . $username . "&rpp=1";
function parse_feed($feed) {
$stepOne = explode("<content type=\"html\">", $feed);
$stepTwo = explode("</content>", $stepOne[1]);
$tweet = $stepTwo[0];
$tweet = str_replace("<", "<", $tweet);
$tweet = str_replace(">", ">", $tweet);
return htmlspecialchars_decode($tweet);
}
$twitterFeed = file_get_contents($feed);
return parse_feed($twitterFeed);
?>