Gossamer Forum
Home : Products : Gossamer Links : Discussions :

verifying secondary links

Quote Reply
verifying secondary links
Hi

I have a field that allows people to enter a URL for an image stored on their own server that displays on their GLinks detailed page

Is there a simple way of using Verify Links to check this second URL as a separate run? (ie not checking at the same time as link URL verification)
Quote Reply
Re: [Alba] verifying secondary links In reply to
Hi,

A script could probably do that :)

If its an image, then a get() should do the job (will use bandwidth though, as its grabbing the file);

Code:
#!/usr/bin/perl

#####################################################
# Load required modules.
# ---------------------------------------------------
use strict;
use lib '/path/to/admin';
use Links qw/$DB $IN $USER $CFG/;
use CGI::Carp qw(fatalsToBrowser);
use Links::Plugins;
use LWP::Simple;
use Links;
use GT::SQL::Condition;

Links::init('/path/to/admin');

my $field = 'Image_URL'; # change to reflect the image URL field on your install


my $sth = $DB->table('Links')->select( [$field,'ID'], GT::SQL::Condition->new($field,'LIKE','%') );
while (my $url = $sth->fetchrow) {
unless (get($url)) {
# bad URL.. do what you want with it here =)
}
}

Just save as find.cgi, upload into your admin folder... and then run from SSH, with;

perl find.cgi

Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!