Waxy.org
Waxy.org is the sandbox of Andy Baio, an independent journalist and programmer living in Portland, Oregon. I 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
July 3, 2009
Brandon Boyer on Treasure World, DS game that turns wifi hotspots into collectible treasure — to play the game, you have to explore the real world
TweetCraft, in-game Twitter client for World of Warcraft — supports uploading screenshots with TwitPic (via)
Augmented reality iPhone London tube station finder — I really could've used this last week (via)
Sour's "Hibi no Neiro," crowdsourced music video — choreographing 64 fans with webcams (via)
Slate's Chris Wilson tracks 10,000 random YouTube URLs for 30 days — 3% hit 1,000 views, more than I would've expected (via)
Pinboard, Maciej Ceglowski's lightweight del.icio.us clone — on the roadmap: "Get acquired by Yahoo and slowly grow useless"
Donkey Kong easter egg discovered 25 years later — created by DadHacker and discovered by Don Hodges, two of my favorite gaming nerds
Newspaper Club — building a customizable newspaper printing service in 60 days; they're using InDesign as the backend
Kevin Kelly's Death Clock in Futurama — this might seem morbid to some, but I find it inspiring
July 2, 2009
Paul Lamere's Coolness Index — are female singers uncool?
Kickstarter's Big Day — 13 projects ended on July 1, raising an average 188% of their goals
Anil Dash on Malcolm Gladwell's criticism of Chris Anderson's Free — I read through Gladwell's New Yorker piece twice, and the arguments seem petty and off base
72-year-old retired boxer beats up knife-wielding knucklehead — the inane Facebook photos make this story even more delicious
July 1, 2009
Pez sues Burlingame Museum of Pez for copyright infringement — so disappointing
RIAA wins lawsuit against Usenet.com — judge rules Betamax case doesn't apply; every other Usenet provider is next
June 30, 2009
EveryBlock releases source code — it was a requirement of their funding from the Knight Foundation
Hype Machine detects cheating on charts, names names — one of the bands responds in the comments and gets schooled by Anthony (via)
Ze Frank on black, white, and shades of green — I'm loving this series
China bans gold farming, real-world sale of virtual goods — Eurogamer estimates 1 million Chinese gold farmers with worldwide trade worth more than US$10 billion annually (via)
The Pirate Bay sold to publicly-traded Swedish gaming company — Brokep's statement is delusional; being acquired will almost certainly kill the site
Michael Rubin's "Droidmaker" book now available for free download! — authoritative 518-page history of Lucasfilm, the creation of Pixar, and much more (via)
June 29, 2009
Jason Rohrer interviewed about "selling out" to make iPhone and ad games — he recently switched from free, open-source games; also, EA claims Spielberg's LMNO isn't cancelled
Nedroid's Cosby Experiment — view all 190 Cosbys
How the NYT kept their reporter's Taliban kidnapping off Wikipedia for seven months — they collaborated with Jimmy Wales directly to freeze the entry; NPR asks if it was ethical (via)
David Fincher may direct Facebook film, adapted by Aaron Sorkin — possibly starring Michael Cera or Shia LaBeouf as Zuckerberg; this sounds familiar (via)
Quarrygirl's undercover investigation of non-vegan ingredients used at L.A.-area vegan restaurants — outstanding blog reporting, with industrial food testing from 17 different restaurants and research into suppliers
June 28, 2009
James Barnett's oil paintings of landscapes from video games — looking at the paintings, I felt like I'd actually visited those locations in real-life (via)
WSJ interviews Brenda Brathwaite about "Train," a board game about the Holocaust — not all games need to be fun (via)
June 27, 2009
How Rob Manuel accidentally started a Michael Jackson moonwalk flashmob — I'm in London right now, and I've seen several massive vigils and tributes on the streets (via)
Top teams join forces to win Netflix Prize — check the leaderboard for the first score to break the 10% improvement threshold (via)

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