Update facebook status with curl

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Update facebook status with curl

    update ur facebook status without logging into facebook.
    Code:
    $username = "@yahoo.com";
    $password = "pass";
    
    
     
      // do login to facebook
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, "https://login.facebook.com/login.php?m&next=http://m.facebook.com/home.php");
      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
      curl_setopt($curl, CURLOPT_POSTFIELDS, "email=" . $username . "&pass=" . $password . "&login=Log In");
      curl_setopt($curl, CURLOPT_ENCODING, "");
      curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . '/cookies_facebook.cookie');
      $curlData = curl_exec($curl);
      curl_close($curl);
     
      // do get post url
      $urlPost = substr($curlData, strpos($curlData, "action=\"/a/home") + 8);
      $urlPost = substr($urlPost, 0, strpos($urlPost, "\""));
      $urlPost = "http://m.facebook.com" . $urlPost;
     
      // do get some parameters for updating the status
      $fbDtsg = substr($curlData, strpos($curlData, "name=\"fb_dtsg\""));
      $fbDtsg = substr($fbDtsg, strpos($fbDtsg, "value=") + 7);
      $fbDtsg = substr($fbDtsg, 0, strpos($fbDtsg, "\""));
     
      $postFormId = substr($curlData, strpos($curlData, "name=\"post_form_id\""));
      $postFormId = substr($postFormId, strpos($postFormId, "value=") + 7);
      $postFormId = substr($postFormId, 0, strpos($postFormId, "\""));
     
      // do update facebook status
      $statusMessage = "ok i just updated my facebook status without logging into my account :-)";
     
      $curl = curl_init();
      curl_setopt($curl, CURLOPT_URL, $urlPost);
      curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
      curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
      curl_setopt($curl, CURLOPT_POST, 1);
      curl_setopt($curl, CURLOPT_POSTFIELDS, "fb_dtsg=" . $fbDtsg . "&post_form_id=" . $postFormId . "&status=" . $statusMessage . "&update=Update Status");
      curl_setopt($curl, CURLOPT_ENCODING, "");
      curl_setopt($curl, CURLOPT_COOKIEFILE, getcwd() . '/cookies_facebook.cookie');
      curl_setopt($curl, CURLOPT_COOKIEJAR, getcwd() . '/cookies_facebook.cookie');
      $curlData = curl_exec($curl);
      curl_close($curl);
     
      echo "Your Facebook status already updated with '" . $statusMessage . "'";
    if anyone mods it share here.

    #2
    Curl method n0t working.is it work in freehost? Show error!

    Comment


      #3
      do not know free host, but make sure your safe mode is off and curl is enabled.

      Comment


        #4
        Originally posted by i_love_php_mysql View Post
        do not know free host, but make sure your safe mode is off and curl is enabled.
        Thanks for your script. I value there is some PHP code we should know how to use.

        p.s.: Facebook will ban account after using this method
        mysterio.al - programming is a functional art

        Comment


          #5
          yup. Use n get banned.

          Comment


            #6
            al u must to do is add php tags nd and also could make a form to login and status msg it field i hve used it for sometime. my account stil not banned. but yes better to use their api than to be using this method.
            Last edited by xcoderx; 27.09.10, 14:41.

            Comment


              #7
              add this link much easier .

              without the http:// below
              facebook.com/share.php?u=http://yoursite.com <<<< edit yoursite.com to your site url

              with it below
              Login | Facebook
              Wapchat4u


              Topsites4u

              Comment


                #8
                lol nice idea but facebook will now ban those accounts who are using services somthing like this one, why dont just login to your facebook account and update all you want, its so easy isnt it? rather than using this stuffs

                Comment


                  #9
                  I used this before, the problem here is the facebook security always asking because my server is not in my couuntry.
                  Did I help you?
                  You can help me too
                  Your donations will help me finance my studies.

                  Comment


                    #10
                    i hear facebook will ban accunts but my account never banned. and why not login? because i use it on my site to show users update on facebook i sure cannot login copy paste my users update manually all the time :-)

                    Comment


                      #11
                      Facebook will not ban such users. Infact, u can achieve the same using wget in client side program. If u know C with some sockets u can make a similar POST method to achieve this. Make sure u include browser id string else FB might generate a unsupported browser page instead..!

                      Comment


                        #12
                        why u don`t just use their API ??

                        Comment

                        Working...
                        X