Waxy.org
Waxy.org is the sandbox of Andy Baio, a journalist/programmer living in Portland, Oregon. I'm the CTO of Kickstarter, created Upcoming.org, and some other stuff too.

Contact Me: log@waxy.org or waxpancake on AIM

Backlinks

Posted May 10, 2002

Occasionally, there's an idea so simple and powerful that you have to drop whatever you're doing and implement it immediately.

Yesterday, I read the Jon Udell article that's making the rounds (via Mefi and Flutterby). I didn't immediately grok it, but seeing it in action (1, 2, 3) did the trick.

Visually, I was inspired by Mark Pilgrim's concise display, but didn't want to periodically parse through my Apache logs. I wanted real-time results without limiting myself to one particular web server log format. So I wrote a Perl script that's now included on every entry page via SSI, using flat files to store the data.

As a result, there may be some issues with scalability on heavily trafficked sites, but I'd think most weblogs wouldn't have a problem. Anyway, if you want to try it, all it requires is Perl, server-side includes, and a world-writable directory to store the files in. Download Waxy Backlinks now. Installation info inside.

Installation is pretty easy, so long as you know your way around a Unix shell.

1. Rename the file from backlink.txt to backlink.cgi.
2. Save the file to a directory readable by your web server and make it executable (e.g. 'chmod 755 backlink.cgi')
3. Create a directory to store the cache files in and make it world-writable (e.g. 'chmod 777 backlink_dir/')
4. Edit line 16 of backlink.cgi, changing the '$backlinkdir' directory to point to your own cache directory.
5. Add the following server-side include to your .shtml file(s), where you want the backlinks to be displayed:
<!--#exec cgi="/cgi/backlink.cgi" -->

That's it! If you'd like, you can optionally customize the display by changing the header, footer, and backlink HTML in the script. If you get stuck, I might be able to help.

8 Comments (Add Yours)

May 13, 2002
4:53 PM  
Andy Baio wrote:

Hmm, I think I need to add a couple features to the script. The ability to set a maximum number of links to display, a minimum threshold of visitors to display, and the option to group recent links by top-level domain. As you can see, it doesn't take long before the list of links gets unruly.


May 29, 2002
10:19 PM  
paul wrote:

This is super cool: I may clone it to track user agents the same way (keep an eye on robots vs real readers). I seem to be showing up in my own backlinks, even though I added myself to the "blacklist."


May 29, 2002
10:40 PM  
Andy Baio wrote:

Are you correctly adding your hostname to the @blacklist array? Try changing it to read something like:

my @blacklist = qw($ENV{HTTP_HOST} subdomain.example.com);


Aug 29, 2002
5:36 PM  
Dawn wrote:

Hi. Found this in a Mefi post which I found through google. Is this Perl script possible to implement on a PHP site. My pages are *.php, so I don't think I can run SSI on a php page. Thanks!


Aug 29, 2002
6:04 PM  
Andy Baio wrote:

I'd recommend using Phil Ringnalda's PHP port of my Backlink script, or this newer version of my script.


Jun 28, 2003
5:19 AM  
feri wrote:

Would you please help me to find out why the back link does not work?
http://www.alphatheme.com/b/archives/000008.shtml
I did try with and SSI works.
The path is also seems correct.
my $backlinkdir = '/home/virtual/site1/fst/var/www/cgi-bin/mt/backlink';

The code was:
I got an error so I did change it to:

I don't know what else should I check?
THX


Jul 16, 2003
2:04 PM  
Michael wrote:

I don't have any idea ... it just don't works.

on my indexpage it looks like:

[...]
echo $display;
?>


backlink.cgi looks like:

my $backlinkdir = '/usr/local/httpd/htdocs/kunden/web121/html/public/backlink';

php = 0

www.feiern-events.com


Jun 20, 2004
8:58 PM  
Steve wrote:

Interesting, I'm gonna try this script...


 
Waxy Links
Ads via The Deck
November 20, 2009
Regretsy gets a book deal — the anonymous author turned out to be April Winchell, collector of audio oddities
Google Chrome OS Demo — a world without a local filesystem and apps; also, the Chrome UI concept video (via)
Patrick Moberg's Internet Vices — funny, Tumblr feels more like beer than wine to me
Charlotte Gainsbourg and Beck's "Heaven Can Wait" — Keith Schofield's surreal video and insane treatment were inspired by FFFFOUND and Reddit, but maybe too explicitly (via)
November 19, 2009
YouTube adds machine-translated automatic captions — starting with some partner channels, but auto-timing is available to everyone today
Microsoft tries to patent Edward Tufte's sparklines — they were recently added to Excel
Leonard Lin's Retweet Avatars for Greasemonkey — a subtle change, but a big improvement
Web-ops god John Allspaw leaves Flickr to join Etsy — he's the last of the original Ludicorp team to go (via)
November 18, 2009
Laptop Steering Wheel Desk — don't miss the product photos
Interview with Ralph Eggleston, Pixar's production designer on WALL-E — from last February, but new to me; I didn't know the Axiom had three passenger classes
NSFW: Animated pixel-art video for Flair's "Trucker's Delight" — warning: very offensive and sexist, but the attention to 16-bit detail by director Jérémie Perin is incredible
NY Observer on Anil Dash's new government 2.0 incubator project — Expert Labs debuted at Web 2.0 today, funded with a $500k grant from the MacArthur Foundation
November 17, 2009
Google's Dan Morrill explains how the Droid autofocus breaks every 24.5 days — this gets second-place for quirkiest Android bug (via)
Conan O'Brien and Andy Richter on Zach Galifianakis' Between Two Ferns — his style of comedy usually makes me uncomfortable, but this made me laugh
The Pirate Bay shuts down their tracker for good — they're switching to DHT instead
November 16, 2009
How Darren at Link Machine Go found Belle de Jour's identity five years ago — Brooke was part of the early UK blog scene
ICU64, real-time visualization of Commodore 64 memory — the developer also posted videos of Paradroid and Boulder Dash (via)
Russell Davies on pretending and "barely games" — his SAP prototype looks like great ambient fun (via)
NYT Magazine on the indie gaming movement — nothing new here, but good overview with a wonderful closing anecdote from Cactus
Tim O'Reilly on the pending War for the Web — "more than that, it's a war against the web as an interoperable platform"
November 14, 2009
Jason Scott rounds up Geocities' top 10 most popular MIDI files — along with a torrent with 51,000 MIDIs rescued by Archive Team
Matt Haughey on the discovery of his brain tumor, treatment, and the Internet's response — there were about 1,000 #mathowielove tweets in 24 hours
Belle de Jour reveals herself after six year of anonymity — only six people in the world knew, she only told her parents yesterday (via)
Paul F. Tompkins debates comedy ethics with Improv Everywhere's Charlie Todd — great discussion, and it's hard not to see where both are coming from (via)
November 13, 2009
Rogue Amoeba stops iPhone app development after App Store idiocy — I'm with Marco, the only fix is allowing external apps, but it's unlikely (via)
Numb3rs on IRC — "Luckily, I speak l33t."
Prank War 8: The Skydiving Prank — hard to say if life-threatening situations are funnier than public humiliation
301 Works, Internet Archive works to preserve URL shortener data — the shorteners will provide regular backups and hand over data on closure, though TinyURL's conspicuously missing
November 12, 2009
Quizipedia — simple game with trivia scraped from Wikipedia entries
Kill Screen, funding a new art magazine about videogames — sounds like the English analogue of Amusement I was hoping for

Andy Baio lives here. Some rights reserved, for your pleasure.