« The Press Defends "Fahrenheit 9/11"... Meekly | Main | Too Real Reality TV »

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.

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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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"-->

  8. 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.


TrackBack

Listed below are links to weblogs that reference Bulletproof Blogrolling:

» blogoSFERICS linked with On My 'To Do' List

» Outside The Beltway linked with Blogging Tip/Plea

» Outside The Beltway linked with Return of the Blogroll

Comments (2)

Okay, I'm hopeless. Here's ... (Below threshold)

Okay, I'm hopeless. Here's my error message:

Data was ok, updating blogroll code
Copying 9a33170bd77782db350bb72801ffc0f6.new to blogroll.inc

Warning: copy(9a33170bd77782db350bb72801ffc0f6.new): failed to open stream: No such file or directory in /[PATH]/blogrollIt.php on line 76
failed to copy 9a33170bd77782db350bb72801ffc0f6.new...
Done.

How would I resolve this?

I think when you're testing... (Below threshold)

I think when you're testing via browser you need to up the permissions to 777 (755 might work). That's not needed once you change to chron.

Note that when testing via browser the cache file will be put in the same directory as the script. If you've got the script in the root then you're probably having a permission problem via the browser that won't exist when run via chron. Move or copy the script to a 777 directory and try it again - it should work.




Advertisements









rightads.gif

beltwaybloggers.gif

insiderslogo.jpg

mba_blue.gif

Follow Wizbang

Follow Wizbang on FacebookFollow Wizbang on TwitterSubscribe to Wizbang feedWizbang Mobile

Contact

Send e-mail tips to us:

[email protected]

Fresh Links

Credits

Section Editor: Maggie Whitton

Editors: Jay Tea, Lorie Byrd, Kim Priestap, DJ Drummond, Michael Laprarie, Baron Von Ottomatic, Shawn Mallow, Rick, Dan Karipides, Michael Avitablile, Charlie Quidnunc, Steve Schippert

Emeritus: Paul, Mary Katherine Ham, Jim Addison, Alexander K. McClure, Cassy Fiano, Bill Jempty, John Stansbury, Rob Port

In Memorium: HughS

All original content copyright © 2003-2010 by Wizbang®, LLC. All rights reserved. Wizbang® is a registered service mark.

Powered by Movable Type Pro 4.361

Hosting by ServInt

Ratings on this site are powered by the Ajax Ratings Pro plugin for Movable Type.

Search on this site is powered by the FastSearch plugin for Movable Type.

Blogrolls on this site are powered by the MT-Blogroll.

Temporary site design is based on Cutline and Cutline for MT. Graphics by Apothegm Designs.

Author Login



Terms Of Service

DCMA Compliance Notice

Privacy Policy