Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

URL checker mod for LinksSQL

Quote Reply
URL checker mod for LinksSQL
I converted this mod for use in Links SQL.
IN add.cgi .....

ADD
use LWP::UserAgent;
AFTER
use Links::HTML_Templates;
use Links: BSQL;

ADD
my ($ua,$req,$res);
$ua = new LWP::UserAgent;
$ua->agent("SexLynx/2.0");
$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;
}
AFTER
# Validate the form input..
$rec = &cgi_to_hash ( $in );
LOCATED WITHIN sub process_form

DONE.
Quote Reply
Re: URL checker mod for LinksSQL In reply to
Hello!

I was fishing for something similar.

I plan to insert an IP_Address instead of URL and was looking for ways, and now you did something similar.

What do you think of a command somewhere there

$command = 'nslookup'

?

And then use a clean address out of it?
I do not know how to.



------------------
rajani











Quote Reply
Re: URL checker mod for LinksSQL In reply to
Ooops...be sure to change SexLynx/2.0 to whatever you want your agent to show as.
i.e.
$ua->agent("SexLynx/2.0");
TO
$ua->agent("Make up some fancy look name to put here");