Just a spur of the moment idea, so feel free to shout it down if I'm still dreaming, but...

search.cpan.org is playing up again.. While people in the CB can just regive their links as kobe:// links, stuff already posted in nodes stick to whichever link was used. Would it be possible to have the actual cpan:// handling code work a little more dynamically? This would involve keeping track of whether the URL is actually reachable (I'm not sure if "every time a link is clicked" is sensible here), and redirecting the user to kobes, if it isn't.

The doc:// link could also benefit from this sort of dynamicness, I believe.

Currently I'm envisioning some sort of cron-type job that keeps tabs in the background, so that the link parsing code just has to link to a currently known-working URL.

C.

Replies are listed 'Best First'.
Re: Making cpan:// link dynamic?
by saskaqueer (Friar) on Jan 19, 2005 at 18:25 UTC

    I'm just going to say that such an addition is unnecessary and might just add more headache than is needed. For example, let's assume that such a cron job was to be run on the perlmonks machine(s). It may happen that for some reason, search.cpan.org is unreachable from the perlmonks server but is reachable from where I am. Just because one client can't reach a server doesn't mean that others are unable to connect.

    Besides, it's nice to think that node contents are static, unless the author (or in certain cases, janitors or gods) changes the content intentionally. Just my $0.02 CDN.

      Node contents are static. What you type gets stored, thus if you type a cpan:// link, then that gets stored. The parsing of that link into an actual URL happens when you *view* the node.

      C.

        Oh I didn't really think about that. The thing that had occurred to me was if anyone out there has a script running that checks for updates to a node, that it would see the updated location of the link. My brain was thinking about extraction from the page, but of course anyone doing this would do it via the XML generator, which would simply provide the [cpan://xxxx] text, and not expand the link.

      I'd tend to say it's OK, so long as we're pointing at some place with the same semantics as where the author originally had them point. Doc:// and perldoc:// should always end up at some copy of the perl documentation, but it's not important what copy. (That's one reason for the more generic name of doc://.)

      While it's possible for the machine to be reachable from some places and not others, that's not a huge worry for me -- for one thing, I'm fairly certian all the machines in question are at pair. What worries me is how we detect "up" and "down". Being able to load a page and get back an "OK" http status does not neccessarly mean that everything is hunky-dory.


      Warning: Unless otherwise stated, code is untested. Do not use without understanding. Code is posted in the hopes it is useful, but without warranty. All copyrights are relinquished into the public domain unless otherwise stated. I am not an angel. I am capable of error, and err on a fairly regular basis. If I made a mistake, please let me know (such as by replying to this node).