How To Cloak ClickBank Hops

Discussion in 'ClickBank' started by skelator, Aug 29, 2008.

Thread Status:
Not open for further replies.
  1. #1
    When You Click a Hop It Brings You To The Product Page and It Shows This

    www.Product.com/?hop=XXXX

    This Is How To Hide The ?hop=XXXX

    Save This File As cblink.cgi

    #!/usr/bin/perl
    use CGI;
    use LWP::UserAgent;
    my $q=new CGI;
    
    ### specify here your default affiliate nickname. it will be used
    ### if you don't add parameter a=youraffnick in the URL (see README.TXT)
    $affnick = "youraffnick";
    
    ################################################################################
    ### nothing to change below
    ################################################################################
    $v = $q->param("v");
    
    if (!$q->param("a")) {
    $a = $affnick;
    }else{
    $a = $q->param("a");
    }
    
    if (!$q->param("v")){
    print "Content-type: text/html\n\n";
    print "Error: vendor nickname not specified\n";
    exit;
    }
    
    $url = "http://$a.$v.hop.clickbank.net";
    GetLink($url);
    &PrintPage;
    
    sub GetLink {
            $nurl=shift;
            $id=shift;
            $ua = new LWP::UserAgent;
            $ua->agent("Mozilla/4.0");
            $req = new HTTP::Request 'GET' => $nurl;
            $req->header('Accept' => 'text/html');
            $res = $ua->request($req);
            if ($res->is_success) {
                    $content=$res->headers_as_string.$res->content;
                    $real_url=$res->base;
                    $content=~/URL=([^\s]+)/;
                    $newurl=$1;
                    $real_url=~s/\?.*$//;
            } else {
                    $real_url=$url;
            }
    
    }
    
    
    sub PrintPage {
    $body = qq~
    <html>
    <head>
    <title>Loading...</title>
    <script language="JavaScript">
    setInterval("window.status='Loading...'",50);
    </script>
    <script language="JavaScript">
    <!--
    function UpdateLoader(){
            document.all.Loader.innerHTML = '<a href="$real_url"><b>Click here if your browser sticks on this page</b></a>';
    }
    setTimeout("UpdateLoader()",3300);
    //-->
    </script>
    <script language="JavaScript" type="text/JavaScript">
    function forward() {
    window.location.replace('$real_url');
    }
    setTimeout("forward()",1200);
    </script>
    </head>
    <body bgcolor="silver">
    <img src="$url" width="1" height="1" border="0">
    <div align="center"><center>
    <table border="0" width="100%" height="98%" cellspacing="0" cellpadding="0">
      <tr>
        <td align="center"><div align="center"><center><table width="100%" border="0"
        cellspacing="0">
          <tr style="font-family: Verdana, Tahoma, Arial; font-size: 14pt">
            <td align="center" ID="Loader"></td>
          </tr>
          <tr style="font-family: Verdana, Tahoma, Arial; font-size: 14pt">
            <td align="center"><noscript><a href="$real_url"><font color="black"><b>Click here if
            your browser sticks on this page</b></font></a></noscript></td>
          </tr>
        </table>
        </center></div></td>
      </tr>
    </table>
    </center></div>
    </body>
    </html>
    
    ~;
    
    print "Content-type: text/html\n\n";
    print $body;
    exit;
    
    }
    
    
    
    Code (markup):
    Change "youraffnick" To Your Affiliate Nickname.

    Save The File Then Upload It To http://www.yourdomain.com/cgi-bin/ and chmod it 755.

    Now instead of regular hoplinks use the following one:

    www.yourdomain.com/cgi-bin/cblink.cgi?v=vendornick
    Code (markup):
    This way script will retrieve real url of that vendor, then you will get
    cookie to be credited for that sale and then it will redirect you to the
    vendor's URL without ?hop=youraffnick at the end.


    Here is a Demo www.water4gasx.com/cgi-bin/cblink.cgi?v=water4gas
     
    skelator, Aug 29, 2008 IP
  2. phish3rz

    phish3rz Peon

    Messages:
    98
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Very nice thankyou mate, :)
     
    phish3rz, Aug 30, 2008 IP
  3. Ripped

    Ripped Well-Known Member

    Messages:
    2,151
    Likes Received:
    55
    Best Answers:
    0
    Trophy Points:
    165
    #3
    or you can do this instead: (this way, most users won't even know they're viewing a different page)

     
    Ripped, Aug 30, 2008 IP
  4. skelator

    skelator Banned

    Messages:
    373
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yes this works but if someone were to view the source code they would find your affiliate id.
     
    skelator, Aug 30, 2008 IP
  5. SSimp

    SSimp Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
     
    SSimp, Oct 3, 2008 IP
  6. rickybuitrago

    rickybuitrago Peon

    Messages:
    170
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    All I do is create a redirect in my cpanel and my aff nick does not show up there. Why dont you guys do this? I mean I find it much simpler...does it not do something your codes do?
     
    rickybuitrago, Oct 3, 2008 IP
Thread Status:
Not open for further replies.