Use PHP crawl Baidu post mailbox data, PHP crawl post-mail _php tutorial

Source: Internet
Author: User

Use PHP crawl Baidu post mailbox data, PHP crawl post-mail


Note: This program may be very suitable for those who do Baidu post-marketing friends.

To visit Baidu Bar when, often see the landlord to share some resources, request to leave the mailbox, the landlord just give hair.

For a popular post, the number of mailboxes left is very much, the landlord needs a copy of those replies to the mailbox, and then paste to send mail, not tortured to death is to be exhausted. Bored to write a crawl Baidu post-mail data procedures, need to take away.

Program implementation of a key crawl post all mailbox and paging crawl mailbox two functions, the interface is too lazy to do, the effect is as follows:

The same as the usual, directly paste source

 Php$url 2="";$page="";if($_get[' Url2 ']== ' ""){    $url 2= "Http://tieba.baidu.com/p/2314539885?pn=1";}Else{    $url 2=$_get[' Url2 '];}if($_get[' Page ']== ' "){    $page= "1";}Else{    $page=$_get[' Page '];}?>
 
  
  
 
Post Link: Phpif($_get[' Type ']!= ""){ $counts=0; if($_get[' type ']== ' GetAll '){ $pages=$_get[' Page ']; $url=$_get[' URL ']; for($i= 0;$i<$pages;$i++){ $ch 2=curl_init (); curl_setopt ($ch 2, Curlopt_url,$url); curl_setopt ($ch 2, Curlopt_followlocation,TRUE); curl_setopt ($ch 2, Curlopt_ssl_verifyhost,FALSE); curl_setopt ($ch 2, Curlopt_ssl_verifypeer,false); curl_setopt ($ch 2, Curlopt_returntransfer,TRUE); $texts= Curl_exec ($ch 2); Curl_close ($ch 2); $dat=getemail ($texts); for($j= 0;$j<Count($dat);$j++){ Echo $dat[$j]."
"; $counts++; } } }Else if($_get[' type ']== ' Getnow '){ $url=$_get[' Url2 ']; $ch 2=curl_init (); curl_setopt ($ch 2, Curlopt_url,$url); curl_setopt ($ch 2, Curlopt_followlocation,TRUE); curl_setopt ($ch 2, Curlopt_ssl_verifyhost,FALSE); curl_setopt ($ch 2, Curlopt_ssl_verifypeer,false); curl_setopt ($ch 2, Curlopt_returntransfer,TRUE); $texts= Curl_exec ($ch 2); Curl_close ($ch 2); $dat=getemail ($texts); for($i= 0;$i<Count($dat);$i++){ Echo $dat[$i]."
"; $counts++; } } Echo'

Total data collected: '. $counts. ' Reviews

';}functionGetemail ($str){ $pattern= "/([a-z0-9\-_\.] +@[a-z0-9]+\. [A-z0-9\-_\.] +)/"; Preg_match_all($pattern,$str,$EMAILARR); return $EMAILARR[0]; }?>

http://www.bkjia.com/PHPjc/1119221.html www.bkjia.com true http://www.bkjia.com/PHPjc/1119221.html techarticle use PHP crawl Baidu post mailbox data, PHP crawl post-mail note: This program may be very suitable for those who do Baidu paste marketing friends. Visit Baidu Post bar, often will see the building ...

  • Related Article

    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.