Skip to content

Instantly share code, notes, and snippets.

@keepanote
Forked from lovemyliwu/china-unicom-cdn.md
Created January 19, 2016 15:42
Show Gist options
  • Save keepanote/747cab34b3798c648da1 to your computer and use it in GitHub Desktop.
Save keepanote/747cab34b3798c648da1 to your computer and use it in GitHub Desktop.
使用联通cdn加速下载

120.52.72.*/original-uri

ip 地址获取脚本

window.success = [];
function test() {
    for(var idx=1;idx<255;idx++){
        var el = document.createElement('img');
        el.src = '//120.52.72.' + idx + '/41.media.tumblr.com/5cb6715c800c5b00969f33c162b317d1/tumblr_nzjh7dPKcD1ssbwqro1_540.png';
        el.setAttribute('ip', '120.52.72.' + idx);
        el.onload = function() {window.success.push(this.getAttribute('ip'))};
    }
}
test();

results:

["120.52.72.22", "120.52.72.23", "120.52.72.24", "120.52.72.20", "120.52.72.29", "120.52.72.19", "120.52.72.26", "120.52.72.25", "120.52.72.27", "120.52.72.33", "120.52.72.31", "120.52.72.28", "120.52.72.34", "120.52.72.35", "120.52.72.30", "120.52.72.37", "120.52.72.36", "120.52.72.32", "120.52.72.39", "120.52.72.40", "120.52.72.43", "120.52.72.41", "120.52.72.21", "120.52.72.46", "120.52.72.42", "120.52.72.45", "120.52.72.38", "120.52.72.44", "120.52.72.55", "120.52.72.52", "120.52.72.56", "120.52.72.58", "120.52.72.49", "120.52.72.59", "120.52.72.48", "120.52.72.53", "120.52.72.71", "120.52.72.72", "120.52.72.70", "120.52.72.75", "120.52.72.51", "120.52.72.76", "120.52.72.57", "120.52.72.77", "120.52.72.54", "120.52.72.78", "120.52.72.79", "120.52.72.80", "120.52.72.47", "120.52.72.83", "120.52.72.74", "120.52.72.73", "120.52.72.69"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment