Display Your Twitter Posts On Your Web Site!

There are lots of resources out there for displaying your latest twitter posts in your website. Some of them require plugins or some may require javascript to work. After trying a few scripts I came across a little PHP script from The Lylo Files that displays up to 20 of your posts on your web site. After using it for a little while I decided to make it more functional.

This script has been updated and given a new name. Check the updated version.

The list of changes from the original are:

  • #Hashtags are now click-able.
  • Changed @reply to include _ underscores and – as many user-names contain these.
  • Added retrieval of published date and it’s associated link.
  • Split the date up so that you can have many different variants like Thu 10 Sep or Sep 10 2009, etc.

Setup

It is pretty simple to set up just copy and paste the above code into your site, change worldoweb to your twitter username and change the $max_tweets to anything between 1 and 20. The default output, in line 51, displays the link at the beginning of the tweet wrapped in bold, strong tags.

Display twitter post on your site

To display the date at the end, change line 51 to:

Display twitter post on your site

You can of course remove the link altogether.

The change the date format string in the tweet (line 51) you can change the default $ddmmyy to any of the following.

  • To display the date like 09 Sep change it to $ddmm
  • To display the date like Sep 09 change it to $mmyy
  • To display the date like Sep 09 2009 change it to $mmddyy
  • To add the day of the week to these use $day.$mmyy.

Download

I hope you enjoyed this script and I would like to thank the original author of the script for making this possible. I would love to hear all of your comments so don’t be shy.

Related Posts

8 thoughts on “Display Your Twitter Posts On Your Web Site!

  1. Updated new script to include time since, like my sidebar. Both v1 & v2 will be available as a zipped download soon. Created a new post and updated the name.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

* Copy this password:

* Type or paste password here:

8,111 Spam Comments Blocked so far by Spam Free Wordpress

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>