1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Free Twitter Web Poster using Curl/PHP

Discussion in 'Black Hat SEO Tools' started by mataff, Aug 21, 2010.

  1. mataff

    mataff Junior Member

    Joined:
    Sep 21, 2008
    Messages:
    139
    Likes Received:
    54
    Just wanted to give back to the forum as it's been an excellent resource over the years. I don't post often but I'm always scanning through the wealth of info available here.

    Anyway, I've rewritten the script to display curl sequentially for posters who are still a bit iffy on using curl. In the beginning I found it easier this way vs all wrapped within a single function.

    REMEMBER to change the hxxp to http in all of the links. Seems I'm still not able to post links in the forum.

    PHP:
    <?php
    set_time_limit
    (0);
    $user "XXXXXXXX"
    $pass "XXXXXXXX"
    $agent "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR";
    $timeout 30
    $cookie_file_path "cookie.txt"

    //$tinyurl = GrabTinyUrl("hxxp://example.com");  //UNCOMMENT TO ENABLE TINYURL FUNCTION
    if (isset($tinyurl)) {
          
    $message "XXXXXXXXXXXXXXXXXXXXXXX " $tinyurl;
    } else {
          
    $message "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";

    $url1 "hxxp://twitter.com/login"
    $refer1 ""
    $ch curl_init(); 
    curl_setopt($chCURLOPT_REFERER$refer1);
    curl_setopt($chCURLOPT_URL$url1);
    curl_setopt($chCURLOPT_USERAGENT$agent);
    curl_setopt($chCURLOPT_COOKIEFILE$cookie_file_path);
    curl_setopt($chCURLOPT_COOKIEJAR$cookie_file_path);
    curl_setopt($chCURLOPT_FAILONERRORfalse);
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($chCURLOPT_FRESH_CONNECTtrue);
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($chCURLOPT_HEADERfalse);
    curl_setopt($chCURLOPT_TIMEOUT$timeout);
    curl_setopt($chCURLOPT_CONNECTTIMEOUT$timeout);
    $result curl_exec($ch);

    preg_match ('/(?s)\<input name="authenticity_token" value="(.*?)" type="hidden"\/\>/',$result$authtoken); 

    if (!empty(
    $authtoken)) {
        
    $post 'authenticity_token=' trim($authtoken[1]) . '&authenticity_token=' trim($authtoken[1]) .
            
    '&return_to_ssl=false&redirect_after_login=&session' urlencode("[username_or_email]") . 
            
    '=' $user '&'  urlencode("session[password]") . '=' $pass '&commit=' urlencode("Sign In"); 
                
        
    $url2 "hxxps://twitter.com/sessions";
        
    curl_setopt($chCURLOPT_USERAGENT$agent);
        
    curl_setopt($chCURLOPT_URL$url2);
        
    curl_setopt($chCURLOPT_SSL_VERIFYHOST0);
        
    curl_setopt($chCURLOPT_SSL_VERIFYPEER0);
        
    curl_setopt($chCURLOPT_REFERER$url1);
        
    curl_setopt($chCURLOPT_COOKIEFILE$cookie_file_path);
        
    curl_setopt($chCURLOPT_COOKIEJAR$cookie_file_path);
        
    curl_setopt($chCURLOPT_FAILONERROR,false);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION,  true);
        
    curl_setopt($chCURLOPT_HEADERfalse);
        
    curl_setopt($chCURLOPT_POST,  true);
        
    curl_setopt($chCURLOPT_POSTFIELDS$post);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    curl_setopt($chCURLOPT_CONNECTTIMEOUT30);
        
    $result curl_exec($ch);
    }
    $check CaptchaCheck($result); 

    if (
    $check == "no") {
        
        
    preg_match ('/(?s)\<input name="authenticity_token" value="(.*?)" type="hidden"\/\>/',$result$authtoken); 
        
        
    $post 'authenticity_token=' trim($authtoken[1]) . '&status=' urlencode($message) .
             
    '&twttr=true&return_rendered_status=true&lat=&lon=&place_id=&display_coordinates=false'
                
        
    $url3 "hxxp://twitter.com/status/update";
        
    curl_setopt($chCURLOPT_USERAGENT$agent);
        
    curl_setopt($chCURLOPT_URL$url3);
        
    curl_setopt($chCURLOPT_REFERER$url2);
        
    curl_setopt($chCURLOPT_COOKIEFILE$cookie_file_path);
        
    curl_setopt($chCURLOPT_COOKIEJAR$cookie_file_path);
        
    curl_setopt($chCURLOPT_FAILONERROR,false);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATION,  true);
        
    curl_setopt($chCURLOPT_HEADERfalse);
        
    curl_setopt($chCURLOPT_POST,  true);
        
    curl_setopt($chCURLOPT_POSTFIELDS$post);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    curl_setopt($chCURLOPT_CONNECTTIMEOUT30);
        
    curl_exec($ch);

        echo 
    'Message Posted - ' $message "\n";
    } else {
        echo 
    "Captcha Found"
    }
        
    curl_close($ch); 

    function 
    CaptchaCheck($result) {

        
    $capcheck stripos($result"recaptcha");
        
        if (
    $capcheck !== false) {
            return 
    "yes";
        } else {
             return 
    "no"
        }    
    }

    function 
    GrabTinyUrl($url) {
            
        
    $tiny_url "hxxp://************************//api-create.php?url=" $url;
        
    $timeout 30
        
    $ch curl_init(); 
        
    curl_setopt($chCURLOPT_REFERER'');
        
    curl_setopt($chCURLOPT_URL$tiny_url);
        
    curl_setopt($chCURLOPT_FAILONERRORtrue);
        
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
        
    curl_setopt($chCURLOPT_FRESH_CONNECTtrue);
        
    curl_setopt($chCURLOPT_RETURNTRANSFERtrue);
        
    curl_setopt($chCURLOPT_TIMEOUT$timeout);
        
    curl_setopt($chCURLOPT_CONNECTTIMEOUT$timeout);
        
    $result curl_exec($ch);
        
    curl_close($ch); 
            
        return 
    trim($result); 
                    
    }

    ?>
    I tested it before posting and it worked perfectly.

    Currently I've been using this to simulate a real user based around a few CPA ads that have been performing well of late.

    I scrape forum comments (to make life easier use google discussions search) based around those keywords and randomize the posting times. I also scan recent twitter posts based on my keywords list and either sending a direct message to the user or follow them if they are within the allowed country of where the CPA specificities.

    Following and getting followed from twitter users happened a heck of a lot quicker when they see "Posted via Web" over anything else.

    ENJOY :D
     
    • Thanks Thanks x 1
    Last edited: Aug 21, 2010
  2. Paper-Boy

    Paper-Boy Elite Member

    Joined:
    Jun 17, 2009
    Messages:
    5,116
    Likes Received:
    1,821
    can you use multiple accs for this?

    and some of your links on your script have been censored.
     
  3. mataff

    mataff Junior Member

    Joined:
    Sep 21, 2008
    Messages:
    139
    Likes Received:
    54
    Definitely. Just make sure you rotate your proxies within the script along with the users and your fine or the easiest way is have one script per user with proxies hard coded in and run them all simultaneously.

    I use a database and pull everything from there but any other method is fine.

    Only link that censored is the tinyurl link.
     
    Last edited: Aug 21, 2010
  4. gotcha5832

    gotcha5832 Newbie

    Joined:
    Feb 11, 2011
    Messages:
    2
    Likes Received:
    0
    I tried this script.
    i got the answer:
    Message Posted - xxxx

    But the message doesn't appear on twitter?
    Do you have any idea.?