• 最写了一段脚本统计拉勾网上的招聘数量


     

    工作机会对比

    数据来源:拉勾网

    android 北京 招聘数量:2861
    android 上海 招聘数量:1396
    android 深圳 招聘数量:1077
    android 杭州 招聘数量:895
    android 广州 招聘数量:690
    android 南京 招聘数量:272
    android 西安 招聘数量:110
    android 苏州 招聘数量:85
    
    
    ios 北京 招聘数量:1931
    ios 上海 招聘数量:1043
    ios 深圳 招聘数量:757
    ios 杭州 招聘数量:562
    ios 广州 招聘数量:507
    ios 南京 招聘数量:162
    ios 西安 招聘数量:85
    ios 苏州 招聘数量:68
    
    
    java 北京 招聘数量:5000
    java 上海 招聘数量:3136
    java 深圳 招聘数量:2057
    java 杭州 招聘数量:1779
    java 广州 招聘数量:1447
    java 南京 招聘数量:506
    java 西安 招聘数量:251
    java 苏州 招聘数量:157
    
    
    web 前端 北京 招聘数量:3300
    web 前端 上海 招聘数量:1735
    web 前端 深圳 招聘数量:1210
    web 前端 杭州 招聘数量:850
    web 前端 广州 招聘数量:750
    web 前端 南京 招聘数量:247
    web 前端 西安 招聘数量:149
    web 前端 苏州 招聘数量:80
    
    
    C 北京 招聘数量:1104
    C 上海 招聘数量:419
    C 深圳 招聘数量:353
    C 广州 招聘数量:224
    C 杭州 招聘数量:211
    C 南京 招聘数量:73
    C 苏州 招聘数量:37
    C 西安 招聘数量:25
    

      

     房价对比

    数据来源:房天下

    苏州  苏州二手房房价信息  1月城市均价 环比上月 8.05%   17675 元/平米
    
    杭州  杭州二手房房价信息  1月城市均价 环比上月 0.23%   20372 元/平米
    
    上海  上海二手房房价信息  1月城市均价 环比上月 3.41%   33521 元/平米
    
    南京  南京二手房房价信息  1月城市均价 环比上月 0.87%   18632 元/平米
    
    西安  西安二手房房价信息  1月城市均价 环比上月 0.11%   7044 元/平米
    
    北京  北京二手房房价信息  1月城市均价 环比上月 0.67%   40679 元/平米
    
    深圳  深圳二手房房价信息  1月城市均价 环比上月 4.57%   43329 元/平米
    

      

    统计工作机会的代码

        var cityList = ["苏州","杭州","南京","上海","西安","北京","深圳","广州"];
        var jobList =  ["ios","java","web 前端"];
    
    
        var expectCount = cityList.length * jobList.length;
        var resultList = [];
        function queryJobCount(city,job){
                jQuery.post("http://www.lagou.com/jobs/positionAjax.json?city="+encodeURIComponent(city),
                    {first:true, pn:1, kd:job}
                    ,function(data){
                        resultList.push({
                            job:job,
                            city:city,
                            totalCount:data.content.totalCount
                        });
    
                        if(resultList.length===expectCount){
                            printAndSortResult();
                        }
                    },"json");
        }
    
        for (var i = 0; i < cityList.length; i++) {
            var city = cityList[i];
            for (var j = 0; j < jobList.length; j++) {
                var job = jobList[j];
                queryJobCount(city,job);
            }
        }
    
    
        function printAndSortResult(){
            resultList = resultList.sort(function(a,b){
                var job = a.job.localeCompare(b.job);
                var city = a.city.localeCompare(b.city);
                var totalCount =  b.totalCount - a.totalCount;
                if (job!=0){
                    return job;
                }
                return totalCount;
            });
    
            for (var i = 0; i < resultList.length; i++) {
                var result = resultList[i];
                console.log(result.job,result.city,"招聘数量:"+result.totalCount)
            }
        }
  • 相关阅读:
    Spring 核心API
    python装饰器
    python作业(day1)
    Kali Linux 更新源
    一维数组模拟数据结构-------栈
    Spring事务管理
    Linux用户管理命令
    Linux 帮助命令
    Spring对jdbc的支持
    springboot集成shiro 循环重定向
  • 原文地址:https://www.cnblogs.com/lhp2012/p/5206491.html
Copyright © 2020-2023  润新知