无聊,"联通网上营业厅"选号尝试

最近北京联通号码出来了185号段,一直没有办北京的号码,在联通网上营业厅上选号码,所以就萌发了选个靓号的想法,于是乎翻了网站的结构,长连接+随机组实现.

立马开始写程序获取手机号码,然后对手机号码筛选靓号(正则匹配,反向引用,零宽断言).

种子地址:

http://num.10010.com/NumApp/GoodsDetail/queryMoreNums?callback=jsonp_queryMoreNums&province=11&cityCode=110&rankMoney=76&q_p=${page}&net=01&preFeeSel=0&Show4GNum=TRUE&_=${random}

用HttpClient做的http请求,返回值是Json格式(用的jsel表达式,个人觉得很犀利的),手机号码中存在moreNumArray的属性里,数组类型.

获取数据,将数据分类筛选,筛选出AAAA,AAA,AABB,ABCD,ABC,DCBA,CBA类型的手机号码,然后保存到本地文件,就是这么简单,程序实现如下:

public class PhoneNumber {

    private static Set<String> NO4 = new TreeSet<String>();
    private static Set<String> AAAA = new TreeSet<String>();
    private static Set<String> AAA = new TreeSet<String>();
    private static Set<String> AABB = new TreeSet<String>();
    private static Set<String> ABCD = new TreeSet<String>();
    private static Set<String> DCBA = new TreeSet<String>();
    private static Set<String> ABC = new TreeSet<String>();
    private static Set<String> CBA = new TreeSet<String>();
    private static AtomicLong phoneNumberSize = new AtomicLong(0);

    public static void main(String[] args) throws IOException, URISyntaxException {
        String seed = "http://num.10010.com/NumApp/GoodsDetail/queryMoreNums?callback=jsonp_queryMoreNums&province=11&cityCode=110&rankMoney=76&q_p=${page}&net=01&preFeeSel=0&Show4GNum=TRUE&_=${random}";

        BasicCookieStore cookieStore = new BasicCookieStore();
        CloseableHttpClient httpClient = HttpClients.custom().setDefaultCookieStore(cookieStore).build();
        try {
            for (int i = 0; i < 100; i++) {
                HttpGet httpget = new HttpGet(seed.replace("${page}", new Integer(1).toString()).replace("${random}", String.valueOf(new Date().getTime())));
                request(httpClient, httpget);
            }
            print();
            report();
        } finally {
            httpClient.close();
        }
    }

    private static void report() throws IOException {
        writer("AAAA",AAAA);
        writer("AAA",AAA);
        writer("AABB",AABB);
        writer("ABCD",ABCD);
        writer("ABC",ABC);
        writer("DCBA",DCBA);
        writer("CBA",CBA);
    }

    private static void writer(String name, Set set) throws IOException {
        File file = new File("./${name}-${data}.phone".replace("${name}", name).replace("${data}", new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date())));
        file.createNewFile();
        PrintWriter writer = new PrintWriter(file);
        writer.println("report:");
        writer.println("=================================");
        writer.println("size : ".concat(String.valueOf(set.size())));
        for (Iterator iterator = set.iterator(); iterator.hasNext(); ) {
            writer.println(iterator.next());
        }
        writer.close();
    }

    private static CloseableHttpResponse request(CloseableHttpClient httpClient, HttpGet httpget) throws IOException {
        CloseableHttpResponse response = httpClient.execute(httpget);
        try {
            HttpEntity entity = response.getEntity();
            //
            String text = getText(entity.getContent(), Charset.defaultCharset());
            String json = text.replaceAll("jsonp_queryMoreNums\\((.*)\\);", "$1");
            Map<String, Object> decode = JSONDecoder.decode(json);
            List moreNumArray = (List) decode.get("moreNumArray");
            int size = moreNumArray.size() / 7;
            phoneNumberSize.addAndGet(size);
            for (int i = 0; i < size; i++) {
                String phoneNo = moreNumArray.get(i * 7).toString();
                if (/*AAAA*/phoneNo.matches("\\d*(\\d)\\1{3,}\\d*")) {
                    AAAA.add(phoneNo);
                } else if (/*AAA*/phoneNo.matches("\\d*(\\d)\\1{2,}\\d*")) {
                    AAA.add(phoneNo);
                } else if (/*AABB*/phoneNo.matches("\\d*(\\d)\\1(\\d)\\2\\d*")) {
                    AABB.add(phoneNo);
                } else if (/*ABCD*/phoneNo.matches("\\d*(?:(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){3,})\\d*")) {
                    ABCD.add(phoneNo);
                } else if (/*DCBA*/phoneNo.matches("\\d*(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){3,}\\d*")) {
                    DCBA.add(phoneNo);
                } else if (/*ABC*/phoneNo.matches("\\d*(?:(?:0(?=1)|1(?=2)|2(?=3)|3(?=4)|4(?=5)|5(?=6)|6(?=7)|7(?=8)|8(?=9)){2,})\\d*")) {
                    ABC.add(phoneNo);
                } else if (/*CBA*/phoneNo.matches("\\d*(?:9(?=8)|8(?=7)|7(?=6)|6(?=5)|5(?=4)|4(?=3)|3(?=2)|2(?=1)|1(?=0)){2,}\\d*")) {
                    CBA.add(phoneNo);
                } else if (!phoneNo.matches("\\d*4\\d*")/*NO4*/) {
                    NO4.add(phoneNo);
                }
            }
        } finally {
            response.close();
        }
        return response;
    }

    private static void print() {
        System.out.println("report:");
        System.out.println("=================================");
        System.out.println("size : ".concat(phoneNumberSize.toString()));
        System.out.println("\tAAAA : ".concat(String.valueOf(AAAA.size())));
        System.out.println("\tAAA : ".concat(String.valueOf(AAA.size())));
        System.out.println("\tAABB : ".concat(String.valueOf(AABB.size())));
        System.out.println("\tABCD : ".concat(String.valueOf(ABCD.size())));
        System.out.println("\tABC : ".concat(String.valueOf(ABC.size())));
        System.out.println("\tDCBA : ".concat(String.valueOf(DCBA.size())));
        System.out.println("\tCBA : ".concat(String.valueOf(CBA.size())));
    }

    public final static String getText(InputStream inputStream, Charset charset) throws IOException {
        StringBuilder text = new StringBuilder();
        try {
            BufferedReader read = new BufferedReader(new InputStreamReader(inputStream, charset.name()));
            String line = null;
            while ((line = read.readLine()) != null) {
                text.append(line);
            }
        } finally {
            if (inputStream != null) {
                inputStream.close();
            }
        }
        return text.toString();
    }
}

采集了100次,很快完成了,保存了本地文件,文件如下:

打开文件一看,分类完成.

兴高采烈的去联通网上营业厅搜索.结果发现没有抓取到的号码,也就是被筛选掉了(喷血),而后查看了他网页的实现,有发现元素纪录着号码信息,也就是numid,也尝试了提交订单,提交时有号码id做校验,困了,也不蛋疼了,睡觉!

<p style="display:none;" id="numInfo" numid="numIdVal18515291341" num="185      1529  1341" price="<span>¥0</span>                                           " monfee="0" nummemo="号码要求月承诺消费0元" numprefee="0" numisnicerule="0" numlevel="0" montime="0"></p>

无聊,"联通网上营业厅"选号尝试

时间: 2024-08-03 15:59:57

无聊,"联通网上营业厅"选号尝试的相关文章

幸运飞艇2码选号技巧

幸运飞艇2码选号技巧█薇同Q:53856299█精准大师级计划,十年经验纯人工做计划,已助千人翻盘上岸,可添加老师交流沟通! 那么多玩彩导师中,我是一个实事求是的.不夸大其词给你们画饼的导师!专业与否不是我说了算,是实力说话,我能带你回血稳 赚,甚至捞第一桶金.这边我想跟彩友说的,计划方案是一方面,自己玩谁都不可能一直中,自认为会看走势盲目下注的都会死的 很惨.计划不一定百分百中,谁都不是神人,我们讲究实事求是.以诚相待,不带忽悠的,怎么玩中奖率高,这是一个值得长期摸 索探讨的话题,我有技巧你有

javascript 双色球选号

<!DOCTYPE html> <html lang="en"> <head>     <meta charset="UTF-8">     <title>双色球选号</title>     <style type="text/css">         .div1{             width:300px;             height:450p

七星彩随机选号程序

1 package com.lovo; 2 3 import java.util.Scanner; 4 5 /** 6 * 七星彩随机选号程序 7 * 8 * 9 */ 10 public class Test05 { 11 12 public static void main(String[] args) { 13 Scanner sc = new Scanner(System.in); 14 System.out.print("机选几注: "); 15 if(sc.hasNextI

Craps赌博游戏、百钱白鸡、七星彩选号、抓小偷、21根火柴、10000以内完美数

Craps赌博游戏 游戏规则:同时扔两颗骰子,第一次扔出的点数数7或则11玩家胜,扔出2.3或则12庄家胜利,否则继续扔骰子. 以后只要扔出和第一次相同的点数玩家胜,扔出7庄家胜. 玩家每次进入有1000的筹码,输完游戏结束! 1 public static void gambleGame() { 2 int a = 0; 3 int money = 1000; 4 for (int j = 0;; j++) { 5 if (money > 0) { 6 System.out.println(&qu

电信网上营业厅-客户充值缴费时间段数据挖掘--spss

最近研究分析了"云南电信网上营业厅"e9宽带续约缴费的数据,目前宽带续约量为171人,今天需要谈论的是:如何利用SPSS挖掘出"客户充值缴费的时间段"客户喜欢在哪个时间段来网厅进行充值缴费 云南电信网上营业厅--客户充值缴费数据如下所示: 第一步:将客户缴费时间 中的"具体时间"提取出来(比如:2:18:40  等这样的数据) 打开SPSS软件,点击 转换--计算变量,进入如下所示页面: 未完待续.

正确率88%、java Swing开发的彩票(排列三)智能选号系统问世

不要问我在哪下载,想要,找我QQ26638719,参与合买一起发财,请进群278678410 本人一直在淘宝发合买,用户名为汗马哥,先看近期试用以来中奖记录,网址:http://www.hmgcp.com, 在下面这个网址里也可以查看淘宝网的中奖记录. http://caipiao.taobao.com/lottery/order/united_detail.htm?united_id=FL4VCM6VVMDMRASSCEKPDUPZXI&db_type=0 下面给几张中奖的截图: 郑重说明:

javascript 双色球选号器

//随机生成号码 var a=["01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16"

关于程序:存款单笔满100以上即可至乐彩3D选号抽288&#160;(对每天福彩3D号码,不依顺序对中送奖,一倍流水)

存款单笔满100以上即可至乐彩3D选号抽288 (对每天福彩3D号码,不依顺序对中送奖,一倍流水) 注册vv193.com的新会员 入款即可获得优惠: 存300送150 十倍流水 即可提款优惠 存200送100 六倍流水 即可提款优惠 存50送58 五倍流水 即可提款优惠 可于AG平台(环亚).MG平台投注打码 链结 : 专线注册

iOS彩票项目--第三天,搭建竞技场和发现,搭建幸运选号和我的彩票界面

一.竞技场搭建--UISegmentedControl的使用 1 // 重写 自定义控制器的view 2 - (void)loadView 3 { 4 UIImageView *imgView = [[UIImageView alloc] initWithFrame:ChaosScreenBounds]; 5 6 imgView.image = [UIImage imageNamed:@"NLArenaBackground"]; 7 imgView.userInteractionEna