We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4385
    • 372 Posts
    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);
    ?>
      DropboxUploader -- Upload files to a Dropbox account.
      DIG -- Dynamic Image Generator
      gus -- Google URL Shortener
      makeQR -- Uses google chart api to make QR codes.
      MODxTweeter -- Update your twitter status on publish.
      • 7231
      • 4,205 Posts
      Nice, thanks grin
        [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

        Something is happening here, but you don&#39;t know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 26931
        • 2,314 Posts
        smiley thanks for sharing! j