function getMeta(varA, varB) {
    if (typeof varB !== 'undefined') {
        alert(varA + ' width ' + varB + ' height');
    } else {
        var img = new Image();
        img.src = varA;
        img.onload = function() {
            getMeta(this.width, this.height);
        }
    }
}

getMeta("http://snook.ca/files/mootools_83_snookca.png");

Nginx 自动禁止爬虫IP采集

### 背景最近我们有一个公开服务提供给客户查询关键词的热度值,由于这个API做在官方网站上,自然没有用户登陆,也没有很高查询成本,所以设计上没有任何鉴权无法进行身份认定,于是就被一个爬虫开了超高并发请求,直接后端的AWS Tomcat CPU被用尽,导致无法响应。爬虫显然...… Continue reading

Redis原子性事务Lua应用

Published on June 28, 2020