瀏覽代碼

Add exempt array for links that do not permit bots

pull/387/head
Dave Machado 6 年之前
committed by GitHub
父節點
當前提交
4dfe2edb58
共有 1 個文件被更改,包括 4 次插入0 次删除
  1. +4
    -0
      build/validate_links.rb

+ 4
- 0
build/validate_links.rb 查看文件

@@ -3,6 +3,7 @@ require 'httparty'
require 'ruby-progressbar'
require 'uri'
allowed_codes = [200, 302, 403, 429]
allowed_links = ["https://www.yelp.com/developers/documentation/v3"]
args = ARGV
filename = args[0]
contents = File.open(filename, 'rb') { |f| f.read }
@@ -33,6 +34,9 @@ progressbar = ProgressBar.create(:total => total)
links.each do |link|
begin
count += 1
if allowed_links.include?(link)
next
end
res = HTTParty.get(link, timeout: 10)
if res.code.nil?
fails.push("(NIL): #{link}")


Loading…
取消
儲存