


Use PHP to capture Baidu Tieba mailbox data, PHP to capture Tieba mailbox_PHP tutorial
Jul 12, 2016 am 08:54 AMUse PHP to capture Baidu Tieba email data, PHP capture Tieba email address
Note: This program may be very suitable for those friends who are doing Baidu Tieba marketing.
When I visit Baidu Tieba, I often see the poster sharing some resources and asking for an email address before the poster sends them.
For a popular post, there are a lot of mailboxes left. The author needs to copy the reply mailboxes one by one, and then paste and send the mail. Either he will be tortured to death or exhausted. I was so bored that I wrote a program to capture Baidu Tieba mailbox data and take away what was needed.
The program implements two functions: one-click capture of all mailboxes of posts and paged capture of mailboxes. The interface is too lazy to do, and the effect is as follows:
Old rule, post the source code directly
<?<span>php </span><span>$url2</span>=""<span>; </span><span>$page</span>=""<span>; </span><span>if</span>(<span>$_GET</span>['url2']==""<span>){ </span><span>$url2</span>="http://tieba.baidu.com/p/2314539885?pn=1"<span>; }</span><span>else</span><span>{ </span><span>$url2</span>=<span>$_GET</span>['url2'<span>]; } </span><span>if</span>(<span>$_GET</span>['page']==""<span>){ </span><span>$page</span>="1"<span>; }</span><span>else</span><span>{ </span><span>$page</span>=<span>$_GET</span>['page'<span>]; } </span>?> <form action="" method="get"> <input type="hidden" value="getAll" name="type" /> <table> <tr> <td>帖子鏈接:</td><td><input type="text" name="url" value="http://tieba.baidu.com/p/2314539885">$page</span>;?>" /></td> </tr> <tr> <td colspan=2><input type="submit" value="抓取全部郵箱數(shù)據(jù)" /></td> </tr> </table> </form> <form action="" method="get"> <input type="hidden" value="getNow" name="type" /> <table> <tr> <td>帖子鏈接:</td><td><input type="text" name="url2" value="<?php echo <span>$url2</span>;?>">php </span><span>if</span>(<span>$_GET</span>['type']!=""<span>){ </span><span>$counts</span>=0<span>; </span><span>if</span>(<span>$_GET</span>['type']=="getAll"<span>){ </span><span>$pages</span>=<span>$_GET</span>['page'<span>]; </span><span>$url</span> = <span>$_GET</span>['url'<span>]; </span><span>for</span>(<span>$i</span>=0;<span>$i</span><<span>$pages</span>;<span>$i</span>++<span>){ </span><span>$ch2</span> =<span> curl_init(); curl_setopt(</span><span>$ch2</span>, CURLOPT_URL, <span>$url</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_FOLLOWLOCATION, <span>TRUE</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_SSL_VERIFYHOST, <span>FALSE</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_SSL_VERIFYPEER, <span>false</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_RETURNTRANSFER, <span>TRUE</span><span>); </span><span>$texts</span> = curl_exec(<span>$ch2</span><span>); curl_close(</span><span>$ch2</span><span>); </span><span>$dat</span>=getEmail(<span>$texts</span><span>); </span><span>for</span>(<span>$j</span>=0;<span>$j</span><<span>count</span>(<span>$dat</span>);<span>$j</span>++<span>){ </span><span>echo</span> <span>$dat</span>[<span>$j</span>]."<br />"<span>; </span><span>$counts</span>++<span>; } } }</span><span>else</span> <span>if</span>(<span>$_GET</span>['type']=="getNow"<span>){ </span><span>$url</span> = <span>$_GET</span>['url2'<span>]; </span><span>$ch2</span> =<span> curl_init(); curl_setopt(</span><span>$ch2</span>, CURLOPT_URL, <span>$url</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_FOLLOWLOCATION, <span>TRUE</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_SSL_VERIFYHOST, <span>FALSE</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_SSL_VERIFYPEER, <span>false</span><span>); curl_setopt(</span><span>$ch2</span>, CURLOPT_RETURNTRANSFER, <span>TRUE</span><span>); </span><span>$texts</span> = curl_exec(<span>$ch2</span><span>); curl_close(</span><span>$ch2</span><span>); </span><span>$dat</span>=getEmail(<span>$texts</span><span>); </span><span>for</span>(<span>$i</span>=0;<span>$i</span><<span>count</span>(<span>$dat</span>);<span>$i</span>++<span>){ </span><span>echo</span> <span>$dat</span>[<span>$i</span>]."<br />"<span>; </span><span>$counts</span>++<span>; } } </span><span>echo</span> '<h2>共采集到數(shù)據(jù):'.<span>$counts</span>.'條</h2>'<span>; } </span><span>function</span> getEmail(<span>$str</span><span>){ </span><span>$pattern</span> = "/([a-z0-9\-_\.]+@[a-z0-9]+\.[a-z0-9\-_\.]+)/"<span>; </span><span>preg_match_all</span>(<span>$pattern</span>,<span>$str</span>,<span>$emailArr</span><span>); </span><span>return</span> <span>$emailArr</span>[0<span>]; } </span>?>

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

?In today's increasingly popular digital asset trading, it is particularly important to understand how to safely and effectively withdraw your digital assets. As a world-renowned digital asset trading platform, ok exchange provides convenient currency withdrawal services. This tutorial will analyze in detail the steps of withdrawing coins on the ok exchange, things to note, and some common questions and answers to help users complete asset transfer smoothly and ensure asset security. Whether you are using ok exchange for withdrawals for the first time or want to further understand the withdrawal process, this article will provide you with clear and practical guidance.

exit() is a function in PHP that is used to terminate script execution immediately. Common uses include: 1. Terminate the script in advance when an exception is detected, such as the file does not exist or verification fails; 2. Output intermediate results during debugging and stop execution; 3. Call exit() after redirecting in conjunction with header() to prevent subsequent code execution; In addition, exit() can accept string parameters as output content or integers as status code, and its alias is die().

To merge two PHP arrays and keep unique values, there are two main methods. 1. For index arrays or only deduplication, use array_merge and array_unique combinations: first merge array_merge($array1,$array2) and then use array_unique() to deduplicate them to finally get a new array containing all unique values; 2. For associative arrays and want to retain key-value pairs in the first array, use the operator: $result=$array1 $array2, which will ensure that the keys in the first array will not be overwritten by the second array. These two methods are applicable to different scenarios, depending on whether the key name is retained or only the focus is on

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The rational use of semantic tags in HTML can improve page structure clarity, accessibility and SEO effects. 1. Used for independent content blocks, such as blog posts or comments, it must be self-contained; 2. Used for classification related content, usually including titles, and is suitable for different modules of the page; 3. Used for auxiliary information related to the main content but not core, such as sidebar recommendations or author profiles. In actual development, labels should be combined and other, avoid excessive nesting, keep the structure simple, and verify the rationality of the structure through developer tools.

Dogecoin Trading App is a mobile trading platform specially designed for digital asset enthusiasts. It integrates market viewing, fast trading and asset management, and is committed to providing users with a safe, stable and convenient trading experience. Through this app, you can keep in mind the latest updates on digital assets such as Dogecoin anytime, anywhere. This article has compiled the latest official version of the app for you. Click the official download link provided in the article to easily obtain the latest version of the app.

The latest version of Binance is v2.102.5, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.

The latest version of Binance is 2.101.8, and the update tutorial is: 1. Click the download link in the web page; 2. Authorize the installation permission of "Allow installation from unknown sources"; 3. Find the downloaded APk and click to install; 4. Click the installed application to open it.
