Post Archive
› December 14, 2003
del.icio.us, php, mt, and caching
Lately I've been inspired by the Veen's work in getting del.icio.us links folded into his site in various ways, first javascript, then perl. Orignially I had used this php script from Aramchek, but I had to remove it since it did not include a built-in cache method. For whatever reason I didn't feel like using the javascript method, and because of my own ineptitude, I couldn't get Veen's perl method rolling, so I realized that I'd have to figure my way around adding caching to the original php script I was using (the one from Aramchek). I think people who actually know this stuff can set up caching 5 ways while blindfolded, I'm not that person so, Simon Willison came to the rescue...
...with his easy to understand and use "Instant Caching with PHP". I simply wrapped the caching script around my modified version of Aramchek's script and then put an include on this site's homepage to grab the actual cache file. A simple GET cron set to load the script once per hour is all it takes to make sure the cache is up-to-date. In the include I'm pointing to the cache rather than directly to the script because Simon's caching technique was meant to be used around an entire page, rather than around a chunk of code that is going to be included elsewhere - if you try including the script itself, the page will end at the bottom of your include - simply pointing to the cache and cron-ing the true script solves the problem. So ok, you might be able to gather that I don't really know what I'm doing with all this, I'm just a tinkerer - and as such my little frankenscript is neither advised nor provided with any warranty, nevertheless, if it's of any use to someone: frankenscript. The red text should be modified for your settings, the green text is the part where the HTML is outputed, and where you'll likely want to customize for your site. Improvements and modifications to this are welcome (post a link to your version), but please credit the original authors as I didn't really add much besides tweaking and sandwiching these together.
Comments
1. December 15, 2003 09:49 AM
2. December 15, 2003 11:25 AM
Dougal Posted…
I just used the del.icio.us RSS feed, then used Magpie RSS to pull the feed into my site. Magpie has built-in caching. The downside is that it doesn't pull in all the metadata. But it's a good quick-n-dirty way to add a dynamic link log to a site.
Nate Posted…
BTW, not exactly sure how the links are being sorted, it's not alphabetical, and it's not in the order I added them. Hmmm.