Welcome to my code-sharing corner of the web. Generally, the code here will be very experimental and dubiously production-ready. Now that you’ve been warned, jump in!

RequestCache (Mephisto plugin)

http://cubanlinks.org/svn/mephisto/plugins/requestcache

This is a tiny chunk of code (40 lines) that I cannot live without. My blog (and other websites I work on) are often glued together with web-service calls to other sites (think Flickr, Amazon, anyone that provides RSS or an API). To make all these calls and render pages without caching is too much of a bottleneck to ignore.

All RequestCache needs is a writable directory to initialize (an expiration time in minutes can also be passed). Then simply pass it URLs. On the first request, it will retrieve the result and save it to the file system (with the name of the file being the MD5 hash of the URL). Subsequent requests will pull from the file system, until the cached file “expires”.

FlickrSets (Mephisto plugin)

http://cubanlinks.org/svn/mephisto/plugins/flickrsets

Display your Flickr sets! FlickrSets makes use the RequestCache and a small hack to flickr.rb (a file distributed with Mephisto in the filtered_column_flickr_macro plugin). For details on this hack please read the Google Groups post.

RssDisplay (Mephisto plugin)

http://cubanlinks.org/svn/mephisto/plugins/rssdisplay

I know (now) that there are other plugins that scan RSS feeds. But mine works with the RequestCache, so bonus points for me! Anyway check it out, it pretty much passes Hash representation of an RSS (or Atom) feed to the liquid block (courtesy of XmlSimple).

80x15-textdrive