Use PHP to capture Baidu Post Bar mailbox data, and use php to capture post bar mailbox
Note: This program may be very suitable for those who do Baidu Post Bar marketing.
When you go to Baidu post bar, you will often see the owner share some resources, asking you to leave an email box before sending it to the owner.
For a hot post, the number of mailboxes left is very large. The landlord needs to copy the reply mailboxes one by one and then paste and send the emails, either suffering or exhausting. It is boring to write a program that captures the mailbox data of Baidu Post Bar and needs to be taken away.
The program implements two functions: one-click capture of all posts mailbox and paging capture of mailbox, the interface is too lazy to do, the effect is as follows:
Old Rules: directly paste the source code
<? Php $ url2 = ""; $ page = ""; if ($ _ GET ['url2 '] = "") {$ url2 = "http://tieba.baidu.com/p/2314539885? Pn = 1 ";}else {$ url2 =$ _ GET ['url2 '];} if ($ _ GET ['page'] = "") {$ page = "1" ;}else {$ page =$ _ GET ['page'] ;}?> <Form action = "" method = "get"> <input type = "hidden" value = "getAll" name = "type"/> <table> <tr> <td> post link: </td> <input type = "text" name = "url" value = "http://tieba.baidu.com/p/2314539885"> $ page;?> "/> </Td> </tr> <td colspan = 2> <input type =" submit "value =" capture all mailbox data "/> </td> </tr> </table> </form> <form action = "" method = "get"> <input type = "hidden" value = "getNow" name =" type "/> <table> <tr> <td> post link: </td> <input type = "text" name = "url2" value = "<? Php echo $ url2;?> "> Phpif ($ _ GET ['type']! = "") {$ Counts = 0; if ($ _ GET ['type'] = "getAll") {$ pages = $ _ GET ['page']; $ url = $ _ GET ['url']; for ($ I = 0; $ I <$ pages; $ I ++) {$ ch2 = curl_init (); curl_setopt ($ ch2, CURLOPT_URL, $ url); curl_setopt ($ ch2, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ ch2, success, FALSE); curl_setopt ($ ch2, success, FALSE, false); curl_setopt ($ ch2, CURLOPT_RETURNTRANSFER, TRUE); $ texts = curl_exec ($ ch2); curl _ Close ($ ch2); $ dat = getEmail ($ texts); for ($ j = 0; $ j <count ($ dat); $ j ++) {echo $ dat [$ j]. "<br/>"; $ counts ++ ;}} else if ($ _ GET ['type'] = "getNow ") {$ url = $ _ GET ['url2 ']; $ ch2 = curl_init (); curl_setopt ($ ch2, CURLOPT_URL, $ url); curl_setopt ($ ch2, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt ($ ch2, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt ($ ch2, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ ch2, CURLOPT_RET URNTRANSFER, TRUE); $ texts = curl_exec ($ ch2); curl_close ($ ch2); $ dat = getEmail ($ texts); for ($ I = 0; $ I <count ($ dat); $ I ++) {echo $ dat [$ I]. "<br/>"; $ counts ++ ;}} echo '