My Photo

Andrew's Info

Andrew's Viewpoint

Logistics Viewpoint

Agoge Logistics News & Jobs

Blog powered by TypePad
Member since 09/2006

Twitter (Last 5 entries)

Here is some script I customised to show the last 5 Twitter entries. It is based on Jon Aquino's code, but made to display 5 items. I loaded it into Typepad Notes (which enables HTML code).

The result looks like this:

...I have uploaded some code for Twitter at http://my.agoge.net 10 mins ago
..."Come to the edge. We might fall. Come to the edge. It's too high! Come to the edge! And they came, and he pushed...... and they flew." 2 days ago

The code is:

<script type="text/javascript">

            function twitterCallback(obj) {

                        var id = obj[0].user.id;

                        var html = '';

                           html += '...' + obj[0].text + '<span style="font-size: 0.6em;"> (' + obj[0].relative_created_at + ')</span></br>';

                           html += '...' + obj[1].text + '<span style="font-size: 0.6em;"> (' + obj[1].relative_created_at + ')</span></br>';

                           html += '...' + obj[2].text + '<span style="font-size: 0.6em;"> (' + obj[2].relative_created_at + ')</span></br>';

                           html += '...' + obj[3].text + '<span style="font-size: 0.6em;"> (' + obj[3].relative_created_at + ')</span></br>';

                           html += '...' + obj[4].text + '<span style="font-size: 0.6em;"> (' + obj[4].relative_created_at + ')</span></br>';

                        document.getElementById('my_twitter_status').innerHTML = html;

            }

            

</script>

<span id="my_twitter_status"></span> <span id="my_twitter_status_time"></span>

<script type="text/javascript" src="http://www.twitter.com/t/status/user_timeline/1368091?callback=twitterCallback&count=5"></script>

Warning:

- You must have at least 5 notes in twitter for it to work.

- You must change your user id number (Shown in red above)

Have fun. Post a comment if you find it helpful.