Use PHP to capture Baidu Post bar mailbox data, and use php to capture post bar mailbox _ PHP Tutorial

Source: Internet
Author: User
Use PHP to capture the mailbox data of Baidu Post Bar, and use php to capture the mailbox of the post bar. Use PHP to capture the mailbox data of Baidu Post Bar, and use php to capture the mailbox of the post bar. 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 that the building uses PHP to capture Baidu Post bar mailbox data, and php crawls the 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

 
 
  
  
 
Post link: 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 "; $ 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, success, FALSE ); curl_setopt ($ ch2, CURLOPT_SSL_VERIFYPEER, false); curl_setopt ($ ch2, CURLOPT_RETURNTRANSFER, TRUE); $ texts = curl_exec ($ ch2); curl_close ($ ch2 ); $ dat = getEmail ($ texts); for ($ I = 0; $ I "; $ Counts ++ ;}} echo 'collected data :'. $ counts. 'string';} function getEmail ($ str) {$ pattern = "/([a-z0-9 \-_ \.] + @ [a-z0-9] + \. [a-z0-9 \-_ \.] +)/"; preg_match_all ($ pattern, $ str, $ emailArr); return $ emailArr [0] ;}?>

Note: This program may be very suitable for those who do Baidu Post bar marketing. When you go to the Baidu Post Bar, you will often see the building...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.