Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init();
- $headerdata = array("Origin: https://www.facebook.com",
- "User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/28.0.1500.95 Safari/537.36",
- "Content-Type: application/x-www-form-urlencoded",
- "Referer: https://www.facebook.com/messages/123456789",
- "Cookie: your cookie data goes here");
- curl_setopt($ch, CURLOPT_URL, 'https://www.facebook.com/ajax/mercury/thread_info.php');
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_POST, 1);
- curl_setopt($ch, CURLOPT_HTTPHEADER, $headerdata);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- // [limit]=20000 messages
- curl_setopt($ch,CURLOPT_POSTFIELDS, "messages[thread_ids][id.123456789][offset]=0&messages[thread_ids][id.123456789][limit]=20000&&client=web_messenger&__user=123456789&__a=1&__dyn=123456789ABCDEF&__req=f&fb_dtsg=ABCDEF&ttstamp=123456789");
- $x = curl_exec($ch); curl_close($ch);
- $x = str_replace("for (;;);", "", $x);
- $data= json_decode($x);
- foreach($data->payload->actions as $value) {
- echo $value->timestamp . "\t" . $value->author . "\t" . str_replace("\n", " ", $value->body). "\n";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement