Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I've tacked the following at the end of your userscript:

    var deps = document.evaluate(
        "//a[contains(text(),'CPAN Dependencies')]",
        document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null );

    if ( deps.snapshotLength > 0 ) {
       GM_xmlhttpRequest({
            method: "GET",
            url: deps.snapshotItem(0).href,
            onload: function ( resp ) { mashupDeps( resp, deps ) }
        });
    }

    function mashupDeps ( resp, deps ) {
        var x = resp.responseText.replace( /\n/g, " " );
        var match = x.match( /Chance of success.*?(\d+%)/ );
        for ( var i = 0; i < deps.snapshotLength; i++ ) {
            deps.snapshotItem(i).innerHTML += " (" + match[1] + ")" ;
        }
    }

    Now, the CPAN Dependencies link also (eventually) shows the running chances percentage. If we can persuade DrHyde to add an xml interface to the results, we could probably do even higher magic with them. :-)

    • Heh :) Now I need to implement GM_xmlhttpRequest in HTTP::Proxy::GreaseMonkey so it works in Safari too...
      • Oh my. On one hand, it should not be impossible, as it's all Javascript and one only has to dig in GreaseMonkey's code to find what's needed. On the other hand, I just peeked at the said GM code, and it's a pretty substancial amount of code. Something tells me it's going to be quiiiite an interesting feature to implement. Good thing that the Christmas vacations and insane quantities of eggnog are just around the corner... :-)

        • I've just released 0.03 which supports GM_xmlhttpRequest and runs your modified version of the script on Safari and FireFox. And to think Aristotle said it couldn't be done :)
          • Doing the impossible. Within 12 hours of the challenge's inception.

            Whoa. Your script-fu *is* strong. 8-o
    • Your wish is my command [cantrell.org.uk]. But if the XML interface starts getting hammered then I might either rate-limit it, or remove it, or change the interface, or paint it purple, or ...
      • Your wish is my command.

        Oooh... Very cool... Thanks!

        *hack* *hack* *tinker* *hack*

        Here! What do you think of this: CPAN_Dependencies [userscripts.org]?

        • Very cool :)
          • Thanks. I must say I'm having a lot of fun tinkering with what is, basically, the CPAN edition of "Pimp My Ride". :-)
        • It doesn't want to install for me (or possibly I just don't know how to install it), so I have no idea :-) but if there's anything I can do to the XML to make it work better for you, please let me know. And I'll add a link to the script from my site shortly.
          • It doesn't want to install for me (or possibly I just don't know how to install it)

            Drat! Hmm... Silly question, but, you do have Greasemonkey installed, right?

            if there's anything I can do to the XML to make it work better for you, please let me know.

            Thanks! I'll remember that. :-)

            I'll add a link to the script from my site shortly.

            Excellent. Fame, here I come!

            • you do have Greasemonkey installed, right?
              Errm, no. I thought it was part of Firefox.
              • Heh. Good thing I remembered the golden rule of debugging: "first, always check if it's plugged in". ;-)

                But yes, if you want the script to work, you have to install GreaseMonkey, or use the cool proxy that Andy came up with (http://search.cpan.org/~andya/HTTP-Proxy-GreaseMonkey-0.05)
    • Looks like Graham's done the ultimate escalation and added a link to cpandeps to all the distribution pages. Unfortunately, the machine it's on at the moment can't handle the traffic. Newer, studlier, stronger, faster, better server coming soon.