Waxy.org
Waxy.org is the sandbox of Andy Baio, a writer and tech entrepreneur in Portland, OR. I work with Expert Labs, helped build Kickstarter, founded Upcoming, made an album, and other stuff too.

Contact Me: Email, AOL IM, or follow me on Twitter.

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
February 3, 2012
Avería, the average font — preview them all (via)
February 2, 2012
How and why Mark Jaquith became an atheist — gripping personal story of the life-affirming shift from faith to evidence (via)
Where's the Pixel? — find and click on the black pixel; you may need to clean your screen first (via)
ARTINFO on the chilling effect of the Prince v. Cariou copyright ruling — the journalist mentions me and Kind of Bloop
Darkness — a brilliant 24-hour comic by French cartoonist Boulet (via)
January 31, 2012
Nano quadrotors flying in formation — don't miss the figure 8 pattern at the end (via)
Bootstrap 2 released — here's the announcement
Jeff Atwood on the risks of unmoderated communities — left to their own devices, popular online communities get taken over by cheap, easy gags (via)
How and why J.D. Roth sold Get Rich Slowly — interesting tale of a founder selling his site, but unable to share the details for years
Yahoo lays off in-house Flickr support team — from what I hear, it was done with 10 minutes' notice to Flickr management
Mapstalgia — videogame maps drawn from memory
January 30, 2012
Shit Programmers Say — strikingly similar to Shit Rocks Say
Impressions of Corporate Logos by a 5-Year-Old — "a cheetah, a cheetah, a cheetah"
Bellbot — web app that beeps when you get new signups or sales
ScratchML — markup language for recording and replaying turntablism
Why are software development task estimations regularly off by a factor of 2-3? — nice piece of Quora fiction (via)
David Carr on Kickstarter's film funding at Sundance — 10% of the festival was funded on Kickstarter, with two optioned by HBO
Why ten-year attendee Mike Pusateri's skipping SXSW this year — I made the same decision to skip this year; I may regret it, but it just wasn't fun last year
MegaUpload's user data set to be destroyed by Friday — collateral damage in the copyright war
Blogging declines across the Inc. 500 — too bad; Twitter and Facebook aren't a replacement for longer-form communication
January 29, 2012
ChatChat — Terry Cavanagh's multiplayer game about being a cat (via)
January 27, 2012
Identifying Ice Cube's "Good Day" — process of elimination
Milkshake — an open-source WebGL music visualizer based on Milkdrop
January 26, 2012
Typographica's favorite typefaces of 2011 — returning after a two-year break
Pirating the Oscars, 2012 — now with 10 years of data; I'll republish the article here tomorrow
Colbert interviews Maurice Sendak — a national treasure; part two
January 25, 2012
Warby Parker's Annual Report — lovely design (via)
Mario meets Tim from Braid — with cameos from Limbo and Super Meat Boy
Bootstrap 2 ready for testing and feedback — here's the awesome preview, with responsive design, new plugins, and tons of new components
January 24, 2012
Method of Action's color matching game — love the colorblind mode

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