Home  >  Article  >  Backend Development  >  PHP realizes the method of grabbing Thunder VIP account, php grabs VIP account_PHP tutorial

PHP realizes the method of grabbing Thunder VIP account, php grabs VIP account_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:45:311134browse

PHP implements the method of capturing Xunlei VIP account, PHP captures vip account

This article describes the example of PHP capturing the Xunlei VIP account. Share it with everyone for your reference. The details are as follows:

After seeing @Jinn_Wei’s Python version of grabbing accounts, I wrote a PHP version
PS1: The code has not been optimized and only implements basic functions
PS2: Snoopy
is used in the code PS3: Test address: http://xunlei.kphcdr.com

<&#63;php
/**
 * 抓取爱密码迅雷VIP账号
 * @author kphcdr@163.com
 */
header("Content-type: text/html; charset=UTF-8");
include 'Snoopy.php';
$url = 'http://www.521xunlei.com/forum-xunleihuiyuan-1.html';
//找出匹配的网址
$snoopy = new Snoopy();
$result = $snoopy->fetchlinks($url)->getResults();
foreach($result as $key=>$val)
{
  if(FALSE === strpos($val, 'thread-'))
  {
    unset($result[$key]);
  }
  else
  {
    if(!strpos($val, '-1-1.html'))
    {
      unset($result[$key]);
    }
  }
}
$real = new Snoopy();
$result = array_values(array_unique($result));
$text = $real->fetchtext($result[1])->getResults();
$text = iconv('gbk','UTF-8//IGNORE',$text);
//匹配出需要的内容
$pattern = '/^迅雷会员账号|迅雷共享账号+[a-zA-Z0-9_]{4,15}+:+[0-9]+爱密码分享密码+[a-zA-Z0-9_]{4,20}\s/';
preg_match_all($pattern,$text,$return);
foreach($return[0] as $a)
{
  echo $a;
  echo '<br />';
}

Snoopy-1.2.3.tar.gz Click here to download from this site.

I hope this article will be helpful to everyone’s PHP programming design.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1040824.htmlTechArticleHow to use PHP to capture Xunlei VIP accounts, PHP to capture VIP accounts. This article describes how to use PHP to capture Xunlei VIP accounts. VIP account method. Share it with everyone for your reference. The details are as follows: Saw @...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn