Bulletproof Blogrolling

A while back I mentioned the work Lloyd Hannesson had done in implementing a caching system for Blogrolling.com users. After a bunch of back and forth discussion he has created an even better (and simpler to implement) caching system.

All you need is the ability to run a chron job (check your hosting control panel). After editing Lloyd’s script to put your blogroll ID in and the name of the cache file you want to create; set the file to run as a chron job every 5 to 10 minutes; then make a simple change to your template and you are free from the Blogrolling.com servers FOREVER!!!

Go read Building A Better Blogroll Cache and get the code. Make sure you come back and read the usage notes below.

]]>< ![CDATA[

Usage Notes:

As the beta tester I have some unique insights into the process of getting the script operational.

  1. Test the script out in your browser before creating the chron job. Simply put the script (via FTP) in one of your web directories and put the filename (with full URL info) into your browser. You will see a partial screen full of well documented status information and any error conditions. You need to resolve any errors before creating the chron job.

  • Note that the script is called blogrollIt.php (the I is capitalized). Linux and Unix servers are case sensitive so I recommend renaming the script to all lower case before FTP’ing it to your server. You can use any name you want so long as it ends in .php. In the examples below I use the default (mixed case) name.

  • If you are a Blogrolling Gold subscriber you can use multiple copies of the script (as I do). Just give each copy a separate name and edit the $blogrollCode line and the $blogrollFile line. If you have three copies of the script running make sure the $blogrollFile value is different in each or one copy of the script will overwrite the cache file created by another copy of the script (since the cache file name defaults to blogroll.inc) – spoken from experience.

  • It does not seem to matter what directory you place the script in. The chron service runs with the required permissions in all of your directories.

  • When run as a chron job the output file ($blogrollFile) will be placed in the root of you hosting account (i.e., /home/username/ – where username is you hosting account name) NOT in you public_html directory where your html files are or the directory where the script is located. This happens because the chron job runs in a different context that your web server service. I actually find this placement preferable as it keeps prying eyes away from the cache files.

  • When creating a chron job (assuming you are using the graphical interface) the command to run is:

    /usr/local/bin/php /home/username/blogrollIt.php

    Note the space between php and /home.

  • To show the blogroll in you template add the following code:For PHP pages:
    <? include (“/home/username/blogroll.inc”); ?>

    For HTML pages:
    <!–#include file=”/home/username/blogroll.inc”–>

  • Start enjoying faster blogroll loads!!! You still do all your blogroll maintenance through the Blogrolling.com interface, and all the goodies like sort order and last updated time are retained.Feel free to ask questions here.

    Too Real Reality TV
    The Press Defends "Fahrenheit 9/11"... Meekly


    1. McGehee June 4, 2004
    2. Kevin June 4, 2004