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
March 12, 2010
8-Bit Austin — I think I'll use this map to get to Datapop 2010
Spritely, jQuery plugin for sprite and background animation — see also: gameQuery
March 11, 2010
Trololololololo Shreds — some context (via)
Preview of Sword & Sworcery EP for the iPhone — looks unlike anything I've ever seen
Sitby.us — essential iPhone-optimized site for SXSWi session planning
Danc on the release of Ribbon Hero — turning Microsoft Office into a game, with competition against your friends (via)
March 10, 2010
"Play" by David Kaplan and Eric Zimmerman — avatars as Russian nested dolls (via)
Chatroulette Map — I think I'd rather not know, thanks (via)
Steamshovel Harry — not sure how I missed this one last year, metagaming with music by Brad Sucks
El Fin Del Mundo by Alberto González Vázquez — there's so much I love about this, I can't quantify it all (via)
March 9, 2010
Wired Reread, blogging the best ads from '90s-era Wired — also, the complete SPIN archives are on Google Books
Academy Award Winning Movie Trailer — related: McSweeney's categories for the meta-awards (via)
Chris Parnell and Andy Samberg perform Lazy Sunday live — for the first time, backed by The Roots
Adam Savage's pursuit of the perfect Blade Runner gun replica — related: his quest for the perfect replica Maltese Falcon and dodo skeleton
The Panic Status Board — the instant feedback made work more game-like
March 8, 2010
Valve ports game library and Steam service to Mac — Portal 2 will be released for Mac simultaneously with PC, along with "all of our future games"
Maciej Ceglowski on the discovery, loss, and rediscovery of the cure for scurvy — fascinating story of bad science and the unintended effects of new information
March 7, 2010
8-Bit NYC, Brett Camper's videogame map of New York — he's using Kickstarter to expand to 15 other cities worldwide
Sleep Is Death, Jason Rohrer's new conversational two-player game — watch the slideshow for details; I just wish it was on the web instead
Obama appoints Edward Tufte to advise on stimulus transparency — "Maybe I'll learn something."
PS22 Chorus sings Phoenix's Lisztomania — I love how expressive they are
Echo Nest and SCHED's guide to SXSW Music — very nicely done, uses Echo Nest's recommendation engine
GameInformer's Portal 2 exclusive cover story — scans, since it's not on GameInformer's site yet; Valve hired the TAG: The Power of Paint team right out of Digipen
March 5, 2010
Cal Henderson on gaming probability in World of Warcraft — he's collected 118 pets, some of which only drop 1 in 10,000 attempts
March 4, 2010
LiveJournal rewrites outbound links with affiliate codes — looks like the regex was a bit greedy
NYT on Chinese "human-flesh search engines" — very similar to the H+ article on the topic from last year
YouTube launches auto-captioning for all videos — a free, automated audio transcription service based on YouTube should be viable now
OK Go's "This Too Shall Pass" — Rube Goldberg machine built by Synn Labs in Los Angeles
Roger Ebert starts subscription service — $4.99 for a year, goes up to $5.00 on April 1
March 2, 2010
Yelp's official response to the business extortion accusation — nicely lays out the case against the conspiracy theories

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