I have a script to put my Twitter feed on my site but can't work out
how to get it to show the date/how long ago it was posted.

Can anyone tell me what I need to add?

// create curl resource
        $ch = curl_init();

        // set url
        curl_setopt($ch, CURLOPT_URL, "http://api.twitter.com/1/

        //return the transfer as a string
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

        // $output contains the output string
        $output = curl_exec($ch);
        $tweetData = simplexml_load_string($output);
        // close curl resource to free up system resources


                echo "<p>";
                    foreach($tweetData as $tweet){

                        echo "$tweet->text";


                    echo "</p><p>A</p><a href='http://twitter.com/
USERNAMEHERE' target='_blank'>Follow us</a>";
                    echo "</p>";

Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 

Reply via email to