Textpattern tips, tutorials and code snippets

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.

5 Comments Comment feed

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

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

Hi Jonathan,

sorry for the late response… I have emaiing a couple of times but yet to hear back. I’ll try your suggestion and head over to the plugin thread.

Thanks for getting back

Hi Jonathan, well i tried contacting the person who created the kml_twitter plugin via email and on the thread as you had suggested. But had no luck what so ever.

Maybe you can help me out with this issue?

http://forum.textpattern.com/viewtopic.php?pid=224215#p224215
Hope to hear back.

First thing I would do is double check I have the /cache directory setup and with the permissions set – mine are 755 which is the default on Joyent.

I’d also check the plugin code to see if the error message is coming from that or from Twitter itself. Have you searched online for the error message?

I found the following on the error message, this too.

Add a comment

Use Textile help to style your comments