How can I check to see if a site has added my link to their site. I want to check this in the add.cgi, and if the link does not exist, return the error page.
I know where I would add the code, and I know some of the coding.
I currently check to see if the link they are adding is good (not misspelled, dead, server error, etc.) with the following code:
my ($ua,$req,$res);
$ua = new LWP::UserAgent;
$ua->agent("MySuperDuperChecker/2.0 (http://www.fooee.com)");
$ua->timeout(30); # set this to what you want in seconds.
$req = new HTTP::Request 'GET' => (${$rec}{'URL'});
$res = $ua->request($req);
unless($res->is_success) {
$name = &get_category_name ($in->param('CategoryID'));
$category = "$name <input type=hidden name='CategoryID' value='" . $in->param('CategoryID') . "'>";
&site_html_add_failure( { error => "URL: ${$rec}{'URL'} -" . " " . $res->code . " " . $res->message, Category => $category, %in });
return;
}
I am sure this is most of the code. If the user lists say www.foobar.com as the locaton of my return link, I want to be able to determine, true or false if www.fooee.com is found in the page.
What would I need to add to that code to do this?
Chris
I know where I would add the code, and I know some of the coding.
I currently check to see if the link they are adding is good (not misspelled, dead, server error, etc.) with the following code:
my ($ua,$req,$res);
$ua = new LWP::UserAgent;
$ua->agent("MySuperDuperChecker/2.0 (http://www.fooee.com)");
$ua->timeout(30); # set this to what you want in seconds.
$req = new HTTP::Request 'GET' => (${$rec}{'URL'});
$res = $ua->request($req);
unless($res->is_success) {
$name = &get_category_name ($in->param('CategoryID'));
$category = "$name <input type=hidden name='CategoryID' value='" . $in->param('CategoryID') . "'>";
&site_html_add_failure( { error => "URL: ${$rec}{'URL'} -" . " " . $res->code . " " . $res->message, Category => $category, %in });
return;
}
I am sure this is most of the code. If the user lists say www.foobar.com as the locaton of my return link, I want to be able to determine, true or false if www.fooee.com is found in the page.
What would I need to add to that code to do this?
Chris