--获取http://www.521xunlei.com/ 免费迅雷账号

function getPageid()
local http = require("socket.http")
local url = "http://521xunlei.com/forum.php?mod=forumdisplay&fid=2&orderby=dateline"
local resp = http.request(url)
local s = string.find(resp, "<tbody id=\"normalthread_")
local e = string.find(resp, "\">", s)
local pageid = string.sub(resp, s + 24, e - 1)
return pageid
end function getDatas()
local urlpre = "http://521xunlei.com/thread-"
local url = urlpre .. getPageid() .. "-1-1.html"
local http = require("socket.http")
local html = http.request(url)
local i = 1
local usrstart, usrend, psdstart, psdend, temp_x, temp_y
while(string.find(html, "爱密码迅雷会员共享", i))
do
i, j = string.find(html, "爱密码迅雷会员共享", i)
usrstart = j + 1
usrend, temp_x = string.find(html, "独家分享密码", j)
psdstart = temp_x + 1
usrend = usrend - 1
temp_y, _ = string.find(html, "</font>", temp_x)
psdend = temp_y - 1
print("用户名:" .. string.sub(html, usrstart, usrend) .. " 密码:" .. string.sub(html, psdstart, psdend))
i = psdend
end
end print(getDatas()) --[[
按照发帖时间将帖子排序
http://521xunlei.com/forum.php?mod=forumdisplay&fid=2&orderby=dateline
最新帖子查找example:
<tbody id="normalthread_8901">
]]

--匹配的字符串有问题了,导致获取不到

参考一篇博文:http://blog.csdn.net/zhangxaochen/article/details/8084396

http://blog.csdn.net/ruiyiin/article/details/25953155

.  任意字符
%s 空白符
%p 标点
%c 控制字符
%d 数字
%x 十六进制数
%z 代表0的字符
%a 字母
%l 小写字母
%u 大写字母
%w 字母数字
字符类的大写形式代表相应集合的补集, 比如 %A 表示除了字母以外的字符集
另外,* + - 三个,作为通配符分别表示:
*: 匹配前面指定的 0 或多个同类字符, 尽可能匹配更长的符合条件的字串
+: 匹配前面指定的 1 或多个同类字符, 尽可能匹配更长的符合条件的字串
-: 匹配前面指定的 0 或多个同类字符, 尽可能匹配更短的符合条件的字串 于是, "(%a+)%s*=%s*(%a+)" 表示, 先匹配一个或多个字母, 然后是零个或多个空白符(比如空格), 然后是个 '=', 然后空白符, 然后字母。这样, 满足匹配的只有 "name = Anna"。 所以输出位置为 2 12.
因为捕获了两个 (%a+), 也就是 name, Anna 这两个单词, 所以还输出了这两个单词

代码更改为:

--获取http://www.521xunlei.com/ 免费迅雷账号

function getPageid()
local http = require("socket.http")
local url = "http://521xunlei.com/forum.php?mod=forumdisplay&fid=2&orderby=dateline"
local resp = http.request(url)
local s = string.find(resp, "<tbody id=\"normalthread_")
local e = string.find(resp, "\">", s)
local pageid = string.sub(resp, s + 24, e - 1)
return pageid
end function getDatas()
local urlpre = "http://521xunlei.com/thread-"
local url = urlpre .. getPageid() .. "-1-1.html"
local http = require("socket.http")
local html = http.request(url)
local title_x, title_y
_, title_x = string.find(html, "<span id=\"thread_subject\">");
title_y, _ = string.find(html, "</span>", title_x)
print("\t" .. string.sub(html, title_x + 1, title_y - 1) .. "\n") local html_x = string.find(html, "<td class=\"t_f\"")
local html_y = string.find(html, "</td>", html_x)
html = string.sub(html, html_x, html_y) --[[
<td class="t_f" id="postmessage_170571">...</td>
]] local i,usrstart, usrend, psdstart, psdend
i = 1
while(string.find(html, "迅雷", i))
do
i, _ = string.find(html, "迅雷", i)
usrstart, usrend = string.find(html, ("(%w+):%d"), i)
if(usrstart == nil or usrend == nil) then
break
end
psdstart, psdend = string.find(html, "%d%d%d%d%d%d%d", usrend)
if(psdstart == nil or psdend == nil) then
break
end
i = psdend + 1
print("账号:" .. string.sub(html, usrstart, usrend) .. "\t密码:" .. string.sub(html, psdstart, psdend))
end
end print(getDatas())
os.execute("pause") --[[
按照发帖时间将帖子排序
http://521xunlei.com/forum.php?mod=forumdisplay&fid=2&orderby=dateline
最新帖子查找example:
<tbody id="normalthread_8901">
]]

测试:

因为获取到的迅雷账号,不一定保证有效,所以要写一个批量登陆验证的脚本。(待续...)

方法:

1、获取窗口句柄

2、sendmessage实现

LUA提取免费迅雷账号的更多相关文章

  1. swift语言注册非免费苹果账号iOS游戏框架Sprite Kit基础教程

    swift语言注册非免费苹果账号iOS游戏框架Sprite Kit基础教程 1.2.3  注册非免费苹果账号swift语言注册非免费苹果账号iOS游戏框架Sprite Kit基础教程 免费的苹果账号在 ...

  2. 免费苹果账号(apple id)申请ios证书p12真机调试

    HBuilder可以直接打包越狱版的ipa包,但需要越狱手机才能安装,如果需要安装到没越狱的手机安装,需要自己申请ios证书打包. 一般是需要一个付费了的苹果开发者账号才能申请ios证书打包. 这里介 ...

  3. 免费ss账号网站

    下面网址按排序顺序优先使用,数字越小优先级越高 1,https://io.freess.today/ 2,https://free-ss.site/ 3,https://ss.freess.org/ ...

  4. 免费s账号网站

    下面网址按排序顺序优先使用,数字越小优先级越高 1,https://io.freess.today/ 2,https://free-ss.site/ 3,https://ss.freess.org/ ...

  5. 微信公众号开发第六课 BAE结合实现迅雷账号随机分享

    迅雷离线是个好东西,那么我们能不能实现这样一个功能,回复迅雷,随机返回一个迅雷账户和密码. 首先在t_type类型表中添加 迅雷以及对应用值xunlei,这样返回的case值中对应值xunlei. 建 ...

  6. codeforge免费下载账号 积分账号 共享账号

    codeforge网站下载代码很好,没有积分怎么办?那么多好的matlab代码,matlab程序,C,JAVA等等,都要充值啊!!! 请用下面共享的codeforge账号密码========> ...

  7. pudn免费下载账号 codeforge积分账号 pudn共享账号 codeforge下载账号

    www.pudn.com和www.codeforge.cn网站下载代码很好,没有积分怎么办?那么多好的matlab代码,matlab程序,C,JAVA等等,都要充值啊!!! 下面的账号积分都用完了,大 ...

  8. 速成KeePass全局自动填表登录QQ与迅雷(包括中文输入法状态时用中文用户名一键登录)

    原文:http://bbs.kafan.cn/thread-1637531-1-1.html 使用目的:1 网页和本地客户端登录一站式解决2 通过KeePss修改密码和登录更方便,可以复制粘贴,省了输 ...

  9. NeuChar 平台使用及开发教程(二):设置平台账号

    在上一篇<NeuChar 平台使用及开发教程(一):开始使用 NeuChar>中我们了解了 NeuChar 的角色和大体功能框架,并进行了注册,本文将介绍如何设置多账号,以便让 NeuCh ...

随机推荐

  1. Windows下使用 npm 命令安装 Appium(详)

    本文主要讲述如何在 Windows 系统上通过 npm 命令行安装 appium Windows 桌面版请在官网选择对应版本下载安装. 官网链接 TestHome 百度网盘下载链接 Tips:Appi ...

  2. 「USACO15FEB」Censoring (Silver) 审查(银) 解题报告

    题面 就是让你--在字符串A中,如果字符串B是A的子串,那么就删除在A中第一个出现的B,然后拼接在一起,一直重复上述步骤直到B不再是A的子串 |A|\(\le 10^6\) 思路: KMP+栈 1.由 ...

  3. 1049 数列的片段和 (20 分)C语言

    给定一个正数数列,我们可以从中截取任意的连续的几个数,称为片段.例如,给定数列 { 0.1, 0.2, 0.3, 0.4 },我们有 (0.1) (0.1, 0.2) (0.1, 0.2, 0.3) ...

  4. 信息熵为什么要定义成-Σp*log(p)?

    信息熵为什么要定义成-Σp*log(p)? 再解释信息熵之前,需要先来说说什么是信息量. 信息量是对信息的度量,单位一般用bit. 信息论之父克劳德·艾尔伍德·香农(Claude Elwood Sha ...

  5. 面试中经常问到的Redis七种数据类型,你都真正了解吗?

    前言 Redis不是一个简单的键值对存储,它实际上是一个支持各种类型数据结构的存储.在传统的键值存储中,是将字符串键关联到字符串值,但是在Redis中,这些值不仅限于简单的字符串,还可以支持更复杂的数 ...

  6. ACID特性及幻读的理解

    事务是关系型数据库的重要特性.它是一个包含了一条或多条SQL语句的逻辑原子单元.一个事务包含的SQL要么全部提交,要么全部回滚. Oracle 官方文档中对事务的描述如下: A transaction ...

  7. Docker+Nginx使用流程(笔记)

    Docker+Nginx使用流程 本教程依据个人理解并经过实际验证为正确,特此记录下来,权当笔记. 注:基于linux操作系统 # uname -r 查看你当前的内核版本 # yum -y insta ...

  8. Fibnoccia 数列简单题

    In the Fibonacci integer sequence, F0 = 0, F1 = 1, and Fn = Fn − 1 + Fn − 2 for n ≥ 2. For example, ...

  9. margin和 padding 以及 float :left和float :right的介绍

    1.margin和padding的介绍 margin是外边距,padding是内边距,用CSS时首先要做的就是把所有标签的margin和padding清空.这样更容易控制布局和兼容浏览器. p li等 ...

  10. python StringIO和ByteIO

    一.StringIO 1.作用:在内存在读写str # 导入模块 from io import StringIO # 实例化StringIO对象 str_io = StringIO() # 向内存中写 ...