Facebook download all messages - beta


SUBMITTED BY: Guest

DATE: Nov. 10, 2013, 4:55 p.m.

FORMAT: Text only

SIZE: 4.2 kB

HITS: 802

  1. <?php
  2. // CODED BY Metts / metts.blog.hu / da.metts@hotmail.com
  3. // FACEBOOK all message download
  4. // A Kódért felelősséget nem vállalok!
  5. // kő még simple_html_dom.php http://simplehtmldom.sourceforge.net/ egy mappaba vele
  6. // elvileg letölti az összes üzenet amit eddig a felhasználóval beszéltünk
  7. include("simple_html_dom.php");
  8. /*
  9. https://m.facebook.com/messages/read/?deleteselected=0&forward=0&
  10. start=1000&
  11. page_size=1000&
  12. tids=id.248478041843774&
  13. sk=inbox&tid=id.248478041843774&
  14. see_older=1&
  15. refid=12
  16. */
  17. set_time_limit(60);
  18. $time = round(microtime(), 3);
  19. function fb_login($login_email, $login_pass,$id,$number)
  20. {
  21. $ch = curl_init();
  22. curl_setopt($ch, CURLOPT_URL, 'http://login.facebook.com/login.php?login_attempt=1');
  23. curl_setopt($ch, CURLOPT_POSTFIELDS,'charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84&locale=en_US&email='.urlencode($login_email).'&pass='.urlencode($login_pass).'&pass_placeholder=&charset_test=%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84');
  24. curl_setopt($ch, CURLOPT_POST, 1);
  25. curl_setopt($ch, CURLOPT_HEADER, 0);
  26. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  27. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  28. curl_setopt($ch, CURLOPT_COOKIEJAR, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
  29. curl_setopt($ch, CURLOPT_COOKIEFILE, str_replace('\\','/',dirname(__FILE__)).'/fb_cookies.txt');
  30. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  31. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3");
  32. curl_exec($ch);
  33. $err = 0;
  34. $err = curl_errno($ch);
  35. if ($err != 0){
  36. curl_close($ch);
  37. echo 'LOGIN: error='.$err."\n";
  38. return(false);
  39. }
  40. else
  41. {
  42. echo " LOGIN: SUCESS<br/>";
  43. echo " GET: http://m.facebook.com/messages/read/?deleteselected=0&forward=0&
  44. start=1000&
  45. page_size=1000&
  46. tids=id.".$id."&
  47. sk=inbox&tid=id.".$id."&
  48. see_older=1&
  49. refid=12 ";
  50. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  51. curl_setopt($ch, CURLOPT_TIMEOUT, '3');
  52. curl_setopt($ch, CURLOPT_COOKIEFILE, 'fb_cookies.txt');
  53. curl_setopt($ch, CURLOPT_NOBODY, false);
  54. curl_setopt($ch, CURLOPT_HEADER, 0);
  55. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  56. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
  57. curl_setopt($ch, CURLOPT_URL, 'http://m.facebook.com/messages/read/?deleteselected=0&forward=0&start='.$number.'&page_size='.$number.'&tids=id.'.$id.'&sk=inbox&tid=id.'.$id.'&see_older=1&refid=12');
  58. curl_setopt( $ch, CURLOPT_ENCODING, "" );
  59. $content = curl_exec($ch);
  60. $myFile = "out.txt";
  61. $fh = fopen($myFile, 'w');
  62. $html = str_get_html($content);
  63. $ret = $html->find('div[class=acw apl abt]');
  64. foreach($ret as $r)
  65. {
  66. fwrite($fh, $r);
  67. fwrite($fh, "----------\n");
  68. }
  69. fclose($fh);
  70. }
  71. }
  72. // m 1 464415590246663
  73. echo "<h1>Facebook download all messages - Coded by Metts</h1><br/>";
  74. $login_email = 'asdd@hotmail.com'; //EMAIL
  75. $login_pass = 'yspass'; //PW
  76. $id = "434242453453";
  77. $number = 300; // ne változtatsd
  78. $data = fb_login($login_email,$login_pass,$id,$number);
  79. ?>

comments powered by Disqus