This actually sounds pretty interesting and I was thinking about setting up such a directory for my own site. Couldn’t one just use cURL (or fopen) to grab the page, read it line by line and use a regular expression to match a link to your site? Perhaps something like this could work (sorry if it doesn’t it’s still early here but I need to find something to do

:
<?php
//change "your_link_database_table" to your actual table's name.
$result = $modx->db->select( '*', 'your_link_database_table', '', '', '' );
//your site's url - this is what you're checking for on each affiliate's page.
$your_url = '';
$output = '';
while( $row = $modx->db->getRow( $result ) ) {
//this of course assumes that the field in your database is named "link"
if( link_checker( $your_url, $row['link'] ) ) {
$output .= '<span style="color:green">A link to your site appears on ' . $row['link'] . '.</span>';
}
else
$output .= '<span style="color:red">A link to your site does not appear on ' . $row['link'] . '.</span>';
}
function link_checker( $your_url, $check_url ) {
$match = false;
if( $handle = @fopen( $check_url, "r" ) ) {
while( !feof( $handle ) ) {
$line = fread( $handle, 1024 );
if( preg_match( '|<a\s+href\s*=\s*"'.$your_url.'[^>]+>(.*?)</a>|', $line ) ) {
$match = true;
break;
}
}
fclose( $handle );
}
return $match;
}
?>
Make a new snippet, paste that code in there and call it (uncached) on a modx document. It *should* work and do what you’d like. You of course need to create a database table for your affiliate links and populate it with data. I’ve added a couple comments to help you out with what needs to be changed. Also, this is very basic. If anyone’s even remotely interested in it I could expand on it to allow for users’ input on the URL to check, which sites to check for links on and stuff like that.
EDIT: Are you looking for an entire link exchange addon, or just the link checker? I came up with the link checker this morning and realized that you probably wanted a link exchange module too afterwards.