Browse Source

Add exempt array for links that do not permit bots

pull/387/head
Dave Machado 6 years ago
committed by GitHub
parent
commit
4dfe2edb58
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      build/validate_links.rb

+ 4
- 0
build/validate_links.rb View File

@@ -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…
Cancel
Save