Loading twitter status...
/ 30.Mar.2007
I finally went ahead and whipped up a quick hack for mephisto to allow me to keep my twitter status and last.fm status updated without killing mephisto’s great caching features. Previously, I was using Dan Webb’s lastfm plugin for mephisto, and my recent modification to the same plugin to make it fetch twitter information instead of lastfm information. This works, to a degree, but the problem comes from the fact that this plugin uses a liquid tag that embeds the xml information on the page. What this means, is that mephisto will cache the page with the current status or lastfm list and recent updates won’t appear until the cache gets flushed. I know there’s a ‘setting’ in dan webb’s plugin that allows you to change the time in which mephisto will auto flush the cache and try to update the page, but it never worked for me.
What I did was create an Ajax request at the bottom of the page that updates the twitter and lastfm information on the fly. This means that the page that mephisto caches will always stay the same. The updates to twitter and lastfm will happen behind the scenes and update the page w/ javascript. Sucks for those of you who don’t have javascript enabled, but works for me. x=)
I want to whip up a versatile plugin for mephisto with this functionality, but that might take a little bit of time for me to pull off correctly and all. I just started a new job serving at a comedy club in the area, so that’s going to take some of my time in the near future, but I promise that as soon as I get some time and figure out how I want to do it, I’ll get this out in a plugin form. It won’t be a plugin just for twitter and mephisto. I want to make it so you can parse any xml file and update any element on your page with that information on the fly so you can keep dynamic content on your site without killing the caches. Stay tuned for more info on this.
micro theme by seaofclouds, edited by me, and powered with Mephisto
2 Comments
The ajax updating sounds like an awesome idea… is this available with the twitter plugin yet? when it is please let me know! :)
Hey liz, The ajax stuff isn’t available in the twitter plugin just yet. I’m actually working on extracting it to a broader range xml parser so you can use the same plugin to slap any type of dynamic content that has an xml file on to your site pretty painlessly. I’ll definitely update here when I release that.
Leave a Comment