WEB greasemonkey script v.Link trimmer?

Discussion in 'OT Technology' started by DillDoe, Jun 25, 2008.

  1. DillDoe

    DillDoe Feels good mang

    Joined:
    Jan 16, 2004
    Messages:
    62,315
    Likes Received:
    46
    Location:
    dilldoe.organ
    anyone has (or know how) a script to trim links?

    I wanna trim links on some websites to remove the referral

    ie. http://xxx.php?blahblah=http://www.thesiteiwant.com

    is there a simple script to trim all that shit in front of the "=" so I only get 'http://www.thesiteiwant.com'
     
  2. Jesse

    Jesse PSN: iamajesse; XBL: Inhale My Rod; G8 GT crew; Ne OT Supporter

    Joined:
    Jan 12, 2005
    Messages:
    25,649
    Likes Received:
    0
    Location:
    California :: (925)
  3. Logik

    Logik Livin la vida broka

    Joined:
    Jun 30, 2000
    Messages:
    20,667
    Likes Received:
    1
    Location:
    The Steel City
    i could write a bash script to do that.

    or do you want it when visiting other people sites?
     
  4. DillDoe

    DillDoe Feels good mang

    Joined:
    Jan 16, 2004
    Messages:
    62,315
    Likes Received:
    46
    Location:
    dilldoe.organ
    I've search and nothing fitting my description came up :hs:

    for visiting other people's sites. I just want to go to the link directly without their stupid referral.
     
  5. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    i've never made a greasemonkey script before, let me see how hard it is and maybe i'll make one for you tonight.
     
  6. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
  7. Josh

    Josh Guest

    $url = 'http://www.google.com?ref=weinersniothc&money=alot';

    if(ereg("http://(.*)\?",$url,$reg)){
    echo " $reg[1] <br />";
    }
     
  8. Josh

    Josh Guest

    ah shit did I get it backwards? why do you just want the end part?
     
  9. Josh

    Josh Guest

    here:

    $url = 'http://www.google.com?ref=www.aol.com';
    if(ereg("=(.*).(com|net|org|info|biz|etc)",$url,$reg)){
    $url = "http://" . str_replace("http://","",$reg[1].".".$reg[2]);
    }
    echo $url;
     
  10. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
  11. DillDoe

    DillDoe Feels good mang

    Joined:
    Jan 16, 2004
    Messages:
    62,315
    Likes Received:
    46
    Location:
    dilldoe.organ
    :bowdown: limp_brisket

    works, but for one of the site I the links doesn't have it's own domain in the link, just the .php (ie. href="/refer.php?=http://blah blah")
     
  12. DillDoe

    DillDoe Feels good mang

    Joined:
    Jan 16, 2004
    Messages:
    62,315
    Likes Received:
    46
    Location:
    dilldoe.organ
    I think I only need a simple string replacement, but I can't get it to work.
     
  13. Josh

    Josh Guest

    are you using this as like a browser plugin or are you integrating it to your website????
     
  14. Limp_Brisket

    Limp_Brisket New Member

    Joined:
    Jan 2, 2006
    Messages:
    48,422
    Likes Received:
    0
    Location:
    Utah
    do you have an example of an actual link? i only look at the query string to begin with so it shouldn't matter if it's domain is missing, i'm guessing my regexp isn't matching for another reason.
     

Share This Page