GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!

GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!

预防方法:

1. 使用随机数字符串,拼接URL!

//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzgyYjIyOGEzNjQ4YmY0NGZjMTE2M2VmNDRjNjJmY2M2MDA4MTQ5NWUvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY3MjY1NjQ1ZjYxNjEzMDMwMzAzMDJlNzA2ZTY3.jpg

2. 禁用下载权限!

https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png

(chrome)

GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!

1

实现方法:

1. Regular Expression 匹配(开头的域名/开头的域名+文件扩展名)

regx = /^https:\/\/camo.githubusercontent.com\/*$/

str = /^https:\/\/s3.amazonaws.com\/github\/ribbons\/*.png$/

2. 禁用页面的JS!

(firefox)

GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!

1

https://github.com/blog/273-github-ribbon

With the rollout of GitHub Pages, why not show the world that you collaborate on GitHub? I’ve prepared these ribbons that you can overlay on your site by copying and pasting the appropriate snippet into your site’s HTML. Make sure to change the URL in the link to contain your username instead of “you”.

See the ribbon in use at defunkt.github.com, pjhyett.github.com, and mojombo.github.com.

If you’re not satisfied with one of the colors here, I’ve provided the PSD files (MIT licensed). Feel free to modify as you please. The font being used is Collegiate.



GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; left: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzgyYjIyOGEzNjQ4YmY0NGZjMTE2M2VmNDRjNjJmY2M2MDA4MTQ5NWUvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY3MjY1NjQ1ZjYxNjEzMDMwMzAzMDJlNzA2ZTY3.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_red_aa0000.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; left: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzEyMWNkN2NiZGMzZTQ4NTUwNzVlYThiNTU4NTA4YjkxYWM0NjNhYzIvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY2NzcyNjU2NTZlNWYzMDMwMzczMjMwMzAyZTcwNmU2Nw==.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_green_007200.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; left: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzU2N2MzYTQ4ZDc5NmUyZmMwNmVhODA0MDljYzlkZDgyYmY3MTQ0MzQvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY2NDYxNzI2YjYyNmM3NTY1NWYzMTMyMzEzNjMyMzEyZTcwNmU2Nw==.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_darkblue_121621.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; left: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzhiNmI4Y2NjNmRhM2FhNTcyMjkwM2RhN2I1OGViNWFiMTA4MWFkZWUvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY2ZjcyNjE2ZTY3NjU1ZjY2NjYzNzM2MzAzMDJlNzA2ZTY3.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_orange_ff7600.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; left: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tL2M2NjI1YWMxZjNlZTBhMTIyNTAyMjdjZjgzY2U5MDQ0MjNhYmYzNTEvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY2NzcyNjE3OTVmMzY2NDM2NjQzNjY0MmU3MDZlNjc=.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_gray_6d6d6d.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; left: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tL2M2Mjg2YWRlNzE1ZTliZWE0MzNiNDcwNTg3MGRlNDgyYTY1NGY3OGEvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjZjNjU2Njc0NWY3NzY4Njk3NDY1NWY2NjY2NjY2NjY2NjYyZTcwNmU2Nw==.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_left_white_ffffff.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzM2NTk4NmExMzJjY2Q2YTQ0YzIzYTkxNjkwMjJjMGI1Yzg5MGMzODcvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjcyNjk2NzY4NzQ1ZjcyNjU2NDVmNjE2MTMwMzAzMDMwMmU3MDZlNjc=.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tL2U3YmJiMDUyMWIzOTdlZGJkNWZlNDNlN2Y3NjA3NTkzMzZiNWUwNWYvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjcyNjk2NzY4NzQ1ZjY3NzI2NTY1NmU1ZjMwMzAzNzMyMzAzMDJlNzA2ZTY3.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_green_007200.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzM4ZWY4MWY4YWNhNjRiYjlhNjQ0NDhkMGQ3MGYxMzA4ZWY1MzQxYWIvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjcyNjk2NzY4NzQ1ZjY0NjE3MjZiNjI2Yzc1NjU1ZjMxMzIzMTM2MzIzMTJlNzA2ZTY3.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_darkblue_121621.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzY1MmM1YjlhY2ZhZGRmM2E5YzMyNmZhNmJkZTQwN2I4N2Y3YmUwZjQvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjcyNjk2NzY4NzQ1ZjZmNzI2MTZlNjc2NTVmNjY2NjM3MzYzMDMwMmU3MDZlNjc=.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_orange_ff7600.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tL2E2Njc3YjA4Yzk1NWFmODQwMGY0NGM2Mjk4ZjQwZTdkMTljYzViMmQvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjcyNjk2NzY4NzQ1ZjY3NzI2MTc5NWYzNjY0MzY2NDM2NjQyZTcwNmU2Nw==.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_gray_6d6d6d.png"></a>


GitHub Ribbons : 谈网站的安全性-资源链接如何 预防/实现 爬虫的批量下载!
<a href="https://github.com/you"><img style="position: absolute; top: 0; right: 0; border: 0;" src="//bbsmax.ikafan.com/static/L3Byb3h5L2h0dHBzL2NhbW8uZ2l0aHVidXNlcmNvbnRlbnQuY29tLzUyNzYwNzg4Y2RlOTQ1Mjg3ZmJiNTg0MTM0YzRjYmMyYmMzNmY5MDQvNjg3NDc0NzA3MzNhMmYyZjczMzMyZTYxNmQ2MTdhNmY2ZTYxNzc3MzJlNjM2ZjZkMmY2NzY5NzQ2ODc1NjIyZjcyNjk2MjYyNmY2ZTczMmY2NjZmNzI2YjZkNjU1ZjcyNjk2NzY4NzQ1Zjc3Njg2OTc0NjU1ZjY2NjY2NjY2NjY2NjJlNzA2ZTY3.jpg" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_white_ffffff.png"></a>

Have feedback on this post? Let @github know on Twitter.

Need help or found a bug? Contact us.

1

1

1

1

 
上一篇:低成本打造一个带宽无限的网站(五)


下一篇:低成本打造一个带宽无限的网站(二)