Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2011  |  syntax: None  |  size: 0.97 KB  |  hits: 346  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?
  2.         $chh = curl_init("https://mobile.twitter.com/session");
  3.         curl_setopt($chh, CURLOPT_HEADER, 0);
  4.         curl_setopt($chh, CURLOPT_POST, 1);
  5.         curl_setopt($chh, CURLOPT_RETURNTRANSFER, 1);
  6.         $q = curl_exec($chh);
  7.         preg_match_all("/authenticity_token\" type=\"hidden\" value=\"([^\"]+)/i", $q, $p);
  8.         preg_match('/Set-Cookie: (.*)\b/', $q, $cookie);
  9.         print_r($cookie);
  10.         print_r($p);
  11.  
  12.  
  13. $post = $p[1][0];
  14.  
  15.  
  16.         $ch = curl_init("https://mobile.twitter.com/session");
  17.         curl_setopt($ch, CURLOPT_HEADER, 0);
  18.         curl_setopt($ch, CURLOPT_POST, 1);
  19.         curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  20.         curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
  21.       curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  22.         curl_setopt($ch, CURLOPT_POSTFIELDS, "authenticity_token=".$post."&username=".rawurlencode("_mariahrocha_")."&password=".rawurlencode("11.08.95")."");
  23.         $output = curl_exec($ch);      
  24.         curl_close($ch);
  25.         echo $output;
  26.  
  27. ?>