Login with CURL to adf.ly

Talk about anything related to adf.ly here
Forum rules
If you post adf.ly links here, YOUR AdF.ly ACCOUNT WILL BE SUSPENDED!

Login with CURL to adf.ly

Postby kilikinho » Thu Jun 23, 2011 12:46 pm

Hi i want to allow only my referees to be a member of my website, therefor i want to automatically check with a script.
PS: i plan to have more than 2'000 people refered by me.

the relevant part of the script goes like this BUT i have no clue why it does not work:

Code: Select all
                       $tokenpage = file_get_contents("http://adf.ly");
            $regex= '~token" value="([^"]*)~';
            preg_match_all($regex,$tokenpage,$match);
            $token = $match[1][0];
            $target1 = "http://adf.ly/login.php";
            
            $postcontent = array();
            $postcontent['token'] = urlencode($token);
            $postcontent['email'] = urlencode("myloginemail");
            $postcontent['password'] = urlencode("mypassword");

            $ch = curl_init ();
            curl_setopt($ch, CURLOPT_URL, $target1 );
            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 4);
            curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.2) Gecko/20090729 Firefox/3.5.2 GTB5');
            curl_setopt($ch, CURLOPT_REFERER,"http://adf.ly");
            curl_setopt($ch, CURLOPT_COOKIEJAR, "/cookies/cookie.txt");
            curl_setopt($ch, CURLOPT_COOKIEFILE, "/cookies/cookie.txt");
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $postcontent);
            $result = curl_exec($ch);
            curl_close( $ch );
            echo $result;
                                .... (continue checking the referees uid's with regex)


the error i am getting is like this:
Sorry, we were not able to process your last request.

Please click here to go back and try again.


Please some adf.ly intern technics give some hints to make this work.

thanks
kilikinho
 

Re: Login with CURL to adf.ly

Postby adfly » Sun Jun 26, 2011 6:24 pm

As detailed over the email we sent.. we do not support the logging in to an AdF.ly through anything other than a standard HTML browser.

We are looking at adding this functionality to our API but at present I'm afraid this is not possible.
adfly
Site Admin
 
Posts: 2630
Joined: Tue May 26, 2009 10:35 pm


Return to Adf.ly Talk

Who is online

Users browsing this forum: Exabot [Bot] and 24 guests

Sponsored by
mlm lead generation