Skip to content

Instantly share code, notes, and snippets.

@FlowerWrong
Created September 20, 2022 01:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlowerWrong/4e9162c97d88494cbf47f8e40b00ccec to your computer and use it in GitHub Desktop.
Save FlowerWrong/4e9162c97d88494cbf47f8e40b00ccec to your computer and use it in GitHub Desktop.
require 'open-uri'
url = 'https://gist.githubusercontent.com/FlowerWrong/bccee4d63a6f0542523074f2ae184094/raw/131d8508d12f5a995524d07a3c45aa21495afd21/smart-config.txt'
open(url).each_line do |row|
arr = row.split(' ')
if arr[0] == 'direct_domain'
arr.each_with_index do |domain, i|
if i == 0
next
end
puts "DOMAIN,#{domain},DIRECT"
end
end
end
open(url).each_line do |row|
arr = row.split(' ')
if arr[0] == 'proxy_domain'
arr.each_with_index do |domain, i|
if i == 0
next
end
puts "DOMAIN,#{domain},PROXY"
end
end
end
open(url).each_line do |row|
arr = row.split(' ')
if arr[0] == 'direct_domain_suffix'
arr.each_with_index do |domain, i|
if i == 0
next
end
puts "DOMAIN-SUFFIX,#{domain},DIRECT"
end
end
end
open(url).each_line do |row|
arr = row.split(' ')
if arr[0] == 'proxy_domain_suffix'
arr.each_with_index do |domain, i|
if i == 0
next
end
puts "DOMAIN-SUFFIX,#{domain},PROXY"
end
end
end
open(url).each_line do |row|
arr = row.split(' ')
if arr[0] == 'direct_domain_keyword'
arr.each_with_index do |domain, i|
if i == 0
next
end
puts "DOMAIN-KEYWORD,#{domain},DIRECT"
end
end
end
open(url).each_line do |row|
arr = row.split(' ')
if arr[0] == 'proxy_domain_keyword'
arr.each_with_index do |domain, i|
if i == 0
next
end
puts "DOMAIN-KEYWORD,#{domain},PROXY"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment