--获取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. 力扣142——环形链表 II

    原题 给定一个链表,返回链表开始入环的第一个节点. 如果链表无环,则返回 null. 为了表示给定链表中的环,我们使用整数 pos 来表示链表尾连接到链表中的位置(索引从 0 开始). 如果 pos ...

  2. 子网划分及NAT技术总结

    近段项目需要用到网络相关的知识,硬着头皮又回顾了一波,这里做一下记录. 一 分类的IP地址 我们使用的IP地址(IP V4)可以划分为A,B,C,D,E 5个类型,其中的D,为组播地址,E类地址为保留 ...

  3. docker-bind挂载

    使用绑定挂载 自Docker早期以来,绑定挂载一直存在.与卷相比,绑定装载具有有限的功能.使用绑定装入时,主机上的文件或目录将装入容器中.文件或目录由其在主机上的完整路径或相对路径引用.相反,当您使用 ...

  4. Java网络编程系列之TCP连接状态

    1.TCP连接状态 LISTEN:Server端打开一个socket进行监听,状态置为LISTEN SYN_SENT:Client端发送SYN请求给Server端,状态由CLOSED变为SYN_SEN ...

  5. Angular.的简单运用

    从script引用angular文件.开始编写angular事件: 在angular文件中添加属性: ag-xxxx;初始化使用: ng-app="name"; 没有这个属性就不会 ...

  6. CI框架获取post和get参数_CodeIgniter使用心得

    请参考:CI文档的输入类部分: $this->input->post()$this->input->get() -------------------------------- ...

  7. Mybatis中jdbcType的类型

    具体支持的类型参见:org.apache.ibatis.type.JdbcType ARRAY, BIT, TINYINT, SMALLINT, INTEGER, BIGINT, FLOAT, REA ...

  8. AVR单片机教程——小结

    本文隶属于AVR单片机教程系列.   第一期挺让我失望的,是我太菜,没有把想讲的都讲出来.经常写了很多,然后一点一点删掉,最后就没多少了. 而且感觉难度不合适,处于很尴尬的位置.讲得简单,难的丢给库, ...

  9. numpy 数值的修改

    一.步骤 1.查找值 使用数组的索引和切片 2.修改值 直接赋值 例子 import numpy as np arr1 = np.arange(0, 24).reshape(4, 6) # 使用数组的 ...

  10. 可视化限流管理,Sentinel 控制台启动和接入

    Sentinel 的使用可以分为核心库和控制台两个部分. 核心库不依赖任何框架/库,集成了主流框架,可以进行单机限流降级等功能, 控制台Dashboard提供了可视化的管理限流规则.对集群进行监控,集 ...