Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Proposal - Update shortcuts pointing to cpan.org to link to mcpan.org

by marto (Cardinal)
on Jun 03, 2014 at 11:07 UTC ( [id://1088386]=monkdiscuss: print w/replies, xml ) Need Help??

In recent weeks http://search.cpan.org has been frequently unreliable including but not limited to 503 responses or no response at all. Could we update the relevant shortcuts to link to http://search.mcpan.org. For the unaware What shortcuts can I use for linking to other information? lists which shortcuts currently link to cpan.org. I believe ambrus has already provided a patch for this. Thanks ambrus.

Update: typo fixes.

Update 31/07/2014: www.cpan.org are now using metacpan.org for the search on the homepage, rather than search.cpan.org.

  • Comment on Proposal - Update shortcuts pointing to cpan.org to link to mcpan.org

Replies are listed 'Best First'.
Re: Proposal - Update shortcuts pointing to cpan.org to link to mcpan.org
by LanX (Saint) on Jun 03, 2014 at 11:44 UTC
    We had a similar discussion last year and I wrote a nodelet hack which automatically redirects such links, so I'm not affected.

    But seems like I never published it...

    I can do it later if anyone is interested (?)

    Cheers Rolf

    (addicted to the Perl Programming Language)

      I'd be interested to see that. However this only solves the problem for those who would use your nodelet hack, those without accounts can't use it even if they wanted to. In the interests of side stepping this issue for everyone I still think this should be changed. Thanks.

        Here we go

        <!-- ========================== PM LINK FIXER ========================== --> <!-- please disable after successful testing --> <h5> Testlinks </h5> [cpan://Data::Dump] <p> [mod://Data::Dump] <p> [http://www.perlmonks.net|www.perlmonks.net] <p> <script><!-- /* redirect links - avoid log out: redirect perlmonks domains to current one! - cpan -> metacpan */ (function (do_log){ var log = function (html){ if (do_log) document.writeln(html); } var fixes=''; var doc_host=document.location.hostname; for (var i in document.links) { var link_host = document.links[i].hostname; var link_href = document.links[i].href; var link_search = document.links[i].pathname; var link = document.links[i]; /* redirect links from other perlmonks domains to current one! * +/ if ( link_host && link_host != doc_host && link_host.match(/^(www\.)?perlmonks.(org|net|com)$/) ) { fixes += '<li> #'+i+' was '+link_host+'</li>\n'; document.links[i].hostname = doc_host; } /* redirect links from cpan to metacpan */ if ( link_host && link_host == 'search.cpan.org' ) { fixes += '<li> #'+i+' fixing '+link.href+'</li>\n'; if ( link.pathname == '/perldoc' ) { link.hostname = 'metacpan.org'; link.pathname = '/module/'+ link.search.split('?')[1]; link.search=''; link.protocol='https:'; } else if ( link.pathname == '/search' ) { link.hostname = 'metacpan.org'; link.search='?q'+link.search.split('&query')[1]; } } } if (fixes) { log('<h5>Fixed Links</h5><small><ol>'); log(fixes); log('</ol></small>'); } })(true); --></script>

        Logging and Testlinks should be disabled after successful testing.

        Cheers Rolf

        (addicted to the Perl Programming Language)

        > those without accounts can't use it even if they wanted to.

        Hmm , actually only those who don't have JS enabled.

        The monastery should have a general JS file.

        Though I'm not sure about the best way to make it a voluntary feature, maybe with cookies?

        update

        Please note that this approach fixes ALL links, not only monastery markup but also plain links. Both within posts and chatterbox.

        Cheers Rolf

        (addicted to the Perl Programming Language)

Re: Proposal - Update shortcuts pointing to cpan.org to link to mcpan.org
by davido (Cardinal) on Jun 03, 2014 at 19:00 UTC

    Given that there are shortcuts both for search.cpan.org, and for metacpan.org, I prefer to trust that the author of a node chose the shortcut that he intended to use. Altering shortcuts en masse seems like bulk alteration of authors' semantic intent.

    I understand that metacpan.org provides a lot more in the way of nifty-widgets, but its response time also seems slower on average (excluding exceptional events such as downtime). When an author selects a shortcut she or he could be making that intentional decision with a knowledge of each site's advantages and disadvantages.


    Dave

      Please keep in mind that cpan-links are more "handy" which might also explain their popularity.

      I can't see the problem to redirect while cpan is down, dead links are not in our interest...

      But IMHO the last decision should be done by the reader not the author nor the monastery.

      So its rather a question of managing user settings and a global flag.

      Cheers Rolf

      (addicted to the Perl Programming Language)

      +1

      I'm inclined to agree with davido on this. I think it's safe to say, Everybody loves choice. Removing/changing en masse i think violates POLA. Ultimately causing unnecessary disappointment.

      Do note; I completely understand your bringing this subject up again, marto, and at first, I felt inclined to agree. But after more thought. I think that while seemingly very helpful. Ultimately, maybe not the best solution.

      Is it possible to perhaps create a banner on PM. For those days that the search CPAN, starts acting up? Could something like that be done, with relative ease? Or better, does anyone know why this happens so often? Really, with all the Perl people here. Someone must have a bit of insight.

      --Chris

      ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH

        I share these opinions.

      Thank you for your reply.

      Sadly the SiteDocClan didn't have enough foresight to declare in advance that cpan:// links to whatever interface is best to read CPAN, and doc:// links to whatever interface is best to read perldoc. Maybe you're right and this is too late to change now. Next time we add a new shortcut, we should declare this kind of freedom. Afterall, if you want links on a particular website, you could use a direct url.

      Update: let me note that my patch would also add new shortcuts to explicitly link to search.cpan.org, namely searchcpan:// searchdist:// searchmod://. I volunteer to document these changes to What shortcuts can I use for linking to other information? and How do I link to modules on CPAN? if the patch is applied.

Re: Proposal - Update shortcuts pointing to cpan.org to link to mcpan.org
by tangent (Parson) on Jun 03, 2014 at 21:34 UTC
    Might be a bit clumsy but could there be a [metacpan] next to each link. Personally I much prefer the metacpan pages.

      Personally, I like the idea of having a primary link to CPAN and secondary link to metaCPAN. I might be old-fashioned and prefer CPAN, but I admit that the recent amount of downtime for CPAN is annoying.

      You must always remember that the primary goal is to drain the swamp even when you are hip-deep in alligators.

      That seems like a reasonable idea to me. If the links are convertible, it could go both ways even: EG cpan(mcpan) and mcpan(cpan).

Re: Proposal - Update shortcuts pointing to cpan.org to link to mcpan.org
by Anonymous Monk on Jun 03, 2014 at 23:56 UTC
      > but I doubt it takes into anchors, and the anchors between metacpan.org and search.cpan.org aren't portable

      Why exactly are deep links not portable?

      For example this CONFIGURATION of Data::Dump translates w/o problems.

      Please elaborate further!

      Cheers Rolf

      (addicted to the Perl Programming Language)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: monkdiscuss [id://1088386]
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found