Display your Twitter feeds

Here is a simple way to display your latest Tweets from Twitter on your site. All you need is a very nice plugin called kml_twitter.

First step – create a cache folder

Once the plugin is installed, you need to create a folder in your /texpattern directory called cache. The folder needs to be writable, set this to 777.

Download and install the plugin

After creating the cache folder, download the kml_twitter plugin, install and activate.

Start your Tweets!

This plugin has many attributes and I use only a couple in the following sample code:

<div class="details">
<h2>Twitter</h2>
<txp:kml_twitter user="your_name" displaytitle="false" breaktag="p" titletag="" wraptag="p" wraptag_class="" />
</div>

Note: On my web host (Joyent), I got a PHP error after activating the plugin. In my case, I had to enable the extension=json.so in my php.ini file.

2 Comments - Comments RSS Feed

Craig Valadez
# 6 February 2010

This is an awesome TXPtip but i am having one issue. My tweets display as they should. But after an hour or so my tweets disappear and an error with a message that says.. “Twitter only allows 150 call per hour…

I’ve tried different values ranging from 100-800 on the CACHE_LIFE. But still keep getting the error.

Any suggestions?

Craig

Jonathan Stubbs
# 7 February 2010

Hi Craig – have you tried posting in the plugin thread on the forum? The author is quite active and responsive.

Add a comment

Required

Required, not displayed

Optional

Use Textile Help to style your comments