Gossamer Forum
Home : Products : Links 2.0 : Installation -- Unix :

let's see if anyone had this problem

Quote Reply
let's see if anyone had this problem
i have 1544 links and when i ask the script to list all it lists 1544 links but when i verify links the first
line says checking 1543 links
anyone is having this problem? is there anyway i can fix it?
bobsie if i deleted one link then i should
have 1543 links when i ask the program to list the links but the program tell me i have 1544 while gives me 1543 links when i verify links. it's a strange problem
Quote Reply
Re: let's see if anyone had this problem In reply to
bobsie i know you upgraded from links1.1 so did i. i never had this problem with links1.1
so the problem could be with links2 nph-verify.cgi or it could be for those who upgraded, i'm wondering if anyone else is having this problem and please tell us if you upgraded from links1.1
Quote Reply
Re: let's see if anyone had this problem In reply to
Hmmm... You may be right. According to my Home Page, the total links on my system is 1,297 and is what the View option in the admin screen says when I view all. But, according to nph-verify.cgi, there are only 1,271 links to check. Since both scripts get their information from the same database, it does seem odd that the totals would be different.

Quote Reply
Re: let's see if anyone had this problem In reply to
bobsie did you figure out the solution?
or should i just forget about it
Quote Reply
Re: let's see if anyone had this problem In reply to
I was waiting for Alex to reply to this thread. However, let me ask you something. Do you have one link that does not contain "http://" or "ftp://"? If so, that may explain the difference because nph-verify.cgi will only validate those type of URLs. It will not validate, for example, "https://", "mailto:" or other similar URLs.
Quote Reply
Re: let's see if anyone had this problem In reply to
interesting point you make here. i do not allow ftp links however i may forgot to type http for one of the links because when i searched for http i only got 1564 links( now i have 1565 links) is there an easy way to find this link without actually going thru all the links
Quote Reply
Re: let's see if anyone had this problem In reply to
Just put this script in your data directory (call it bad_url.pl), chmod it to 755, and run it. It should provide the information you want.

Code:
#!/usr/bin/perl
# -------------------------------------------
# Change next line to full path to links.cfg if you have problems.
require "../links.cfg";
require "$db_lib_path/db_utils.pl";
require "$db_lib_path/links.def";

$ENV{'REQUEST_METHOD'} and (print "Content-type: text/plain\n\n");
$found = 0;
open (DB, "<$db_links_name")
or print "Unable to open links database 'links.db'. Reason: $!\n" and exit;
LINE: while (<DB> )
{
/^#/ and next LINE; # Skip comment Lines.
/^\s*$/ and next LINE; # Skip blank lines.
chomp; # Remove trailing new line.
@rec = &split_decode($_);
if ($rec[$db_url] !~ 'http://') {
print "Record $rec[$db_key] contains an invalid URL\n";
$found = 1;
}
}
close DB;
if (!$found) {
print "No bad URLs found.\n";
# ---------------------------------------------

I hope this helps.
Quote Reply
Re: let's see if anyone had this problem In reply to
my isp require the directory where cgi scripts reside must be chmod to 755
and the data directory chmod to 666
so can i put the script you wrote in a different directory, if so what changes do i need to make
Quote Reply
Re: let's see if anyone had this problem In reply to
You will only need to change the require line for links.cfg, as it states. The script will need that file to find the other paths.
Quote Reply
Re: let's see if anyone had this problem In reply to
when i run the script i get an error

Missing right bracket at line 25
Quote Reply
Re: let's see if anyone had this problem In reply to
Oops... sorry about that. Change the last if statement to read:

Code:
if (!$found) {
print "No bad URLs found.\n";
}

I hope that fixes it.
Quote Reply
Re: let's see if anyone had this problem In reply to
thankyou it worked!
it turned out someone submitted a site which starts with
htp://
and i did not see it
spelling mistakes happen.
you might want to add your script to the resource center. i'm sure alot of people can use it.
thanks again bobsie!!!
Quote Reply
Re: let's see if anyone had this problem In reply to
now when i search for http:// i get 1745 links and when i view all i get 1745 but when i verify links i get 1743 links.
so what could be the problem