Results 1 to 4 of 4

Thread: Bookmarklet to fix broken links (aodb/aomainframe)

  1. #1

    Bookmarklet to fix broken links (aodb/aomainframe)

    So, I've recently returned to the game, and got a bit annoyed about the number of broken links in old posts/guides.

    I may have already been posted, but here is a bookmarklet to fix the most common site references.

    Make a new bookmark with whatever name you like, and use this as the url (it is one line)


    Edit: Improved version linking to Xyphos.com as suggested. This one also works when the link specifies a QL after the item id, instead of expecting the item id to be the last parameter.
    Edit2: Added handling for 'net' domains and non-item aodb links. Updated version linking to auno, as for noobs like me the comments saying where to find stuff are useful.

    Code:
    javascript:(function(){var x,i; x=document.links;for(i=0;i<x.length;++i) { if (/(aodb|aomainframe).(com|info|net)\/showitem/.test(x[i].href)) {z=x[i].href.match(/id=[^?]+/i); x[i].href="http://www.xyphos.com/ao/aodb.php?"+z; x[i].href=x[i].href.toLowerCase()} if (/(aodb|aomainframe).(com|info|net)/.test(x[i].href)) { z=x[i].href.match(/[^\/]+$/);x[i].href="http://ao.tcdev.de/"+z; } }})();
    Auno version:

    Code:
    javascript:(function(){var x,i; x=document.links;for(i=0;i<x.length;++i) { if (/(aodb|aomainframe).(com|info|net)\/showitem/.test(x[i].href)) {z=x[i].href.match(/id=[^?]+/i); x[i].href="http://auno.org/ao/db.php?"+z; x[i].href=x[i].href.toLowerCase()} if (/(aodb|aomainframe).(com|info|net)/.test(x[i].href)) { z=x[i].href.match(/[^\/]+$/);x[i].href="http://ao.tcdev.de/"+z; } }})();
    Click on this when on a page with bung links and it will update the links on the page:

    - Aodb/aomainframe item references will be changed to auno

    - Other aomainframe links will be updated to the archived copy at ao.tcdev.de

    Should work on any modern browser, only tested with chrome though.


    Hopefully this is of use to some of you.
    Last edited by Anodyne; Jul 6th, 2011 at 23:51:28. Reason: Update to recognise more links

  2. #2
    Just rewrite them so they get to xyphos.com since it is the only one most up to date and getting updated
    ------------------------------------------------------------------------------
    Old maintainer and hoster of Helpbot, Xyphos, AO Minecraft Server, AO Devs
    Old dictator on Atlantean

  3. #3
    this--^

    oh snap, we had a patch yesterday and I was out.
    I gotta patch up soon(tm)

    EDIT: Patched!
    from the looks of things, I'm very looking forward to the 10th anniversary
    Last edited by Xyphos; Jun 10th, 2011 at 20:18:52.
    "When life knocks you on your butt, you have to get back up and punch it in the face." --DJ Ashval of GSP

    Nullified "Bitbucket" Deadcode - 220/25 Neut NanoMage Engi
    Bits10 - 150/14 Clan Opifex Trader

  4. #4
    Very nice thank you very much!

    Boomarklet helped me when going through Engelens MA guide!

    One small change though:

    when matching the aomainframe links apparently you also need to check for a TLD of .net, so instead of

    Code:
    (aodb|aomainframe).(com|info)
    make it

    Code:
    (aodb|aomainframe).(com|info|net)
    Last edited by Flink; Jul 6th, 2011 at 17:37:06.
    .
    Tired of having endless amounts of pocketboss patterns taking up space in your bank?

    Bump this!
    .

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •