mirror of
https://github.com/hahwul/WebHackersWeapons.git
synced 2024-10-01 01:25:58 -04:00
Update fetch_lang
This commit is contained in:
parent
6915ffba4a
commit
4d191bb9df
@ -13,17 +13,18 @@ Dir.entries("./weapons").each do | name |
|
||||
lang = `curl -s https://api.github.com/repos/#{t[3]}/#{t[4]}/languages | jq 'to_entries | max_by(.value) | .key'`
|
||||
lang_str = lang.gsub("\"","").gsub("\n","")
|
||||
if lang_str != "documentation_url"
|
||||
puts "hit #{filename}"
|
||||
puts "hit #{name}"
|
||||
data['lang'] = lang_str
|
||||
yaml_data = YAML.dump(data)
|
||||
File.write("./weapons/#{filename}", yaml_data)
|
||||
File.write("./weapons/#{name}", yaml_data)
|
||||
langs.push lang_str
|
||||
else
|
||||
puts "denied #{filename}"
|
||||
puts "denied #{name}"
|
||||
end
|
||||
sleep(90)
|
||||
end
|
||||
rescue
|
||||
rescue => e
|
||||
puts e
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user