Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

[idea] Conditional build when Link Status changes

Quote Reply
[idea] Conditional build when Link Status changes
Background

A large proportion of our links are on servers maintained by universities and organizations in countries with very poor telecom infrastructure. For many of these links, status codes that are not 200 are routine, especially -1 and -4. So the current and recent state of the server, and ability to access it from outside the country is important information about the link. It must be the same for many other LSQL projects, even if only to demonstrate that link rot is not tolerated.

We run nph-verify as a cron job every 12 hours to check on bad links, 301s and 302s, and we show link status on the detailed pages (with a 'broken' icon for the 40x bad links).

What we would like is to keep the static detailed pages accurate without rebuilding all of them. For example, if link status changes from bad (eg: < 0 , > 400) to 'not bad' or vice-versa, we need a new condition for nph-build.cgi, sub _build_detailed -- but we can't think of anything that would work. The values in Date_Checked and Status don't tell us if anything has changed.


Possible Solution

A new column in the link table called StatusChanged.
The value of the column would be set in nph-verify.cgi, sub link_report, eg:
Code:
(Pseudocode)
$oldstatus = Status; ## ie: the current db column value
if ($oldstatus != $status) { ## ie: the new reported value
StatusChanged = 'Yes'; ## set the db column
}

That would give us a new condition for building detailed pages, eg;
$cond->add ('StatusChanged', '=', 'Yes');

It's probably quite easy for a skilled Perl-ist. Anyone know how to do it?
Quote Reply
Re: [YoYoYoYo] [idea] Conditional build when Link Status changes In reply to
That sounds like a good idea. I am no perl-ist, but I am sure this could be done.

Its like a semi-dynamic links but with static html pages.


http://www.iuni.com/...tware/web/index.html
Links Plugins