Created
June 19, 2014 00:02
-
-
Save williamho/6e5c2d1b1b192e2b4ac8 to your computer and use it in GitHub Desktop.
extract unique referer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'json' | |
file = File.read 'ads_merg_conf.json' | |
json = JSON.parse file | |
ir = json.flat_map do |placement, values| | |
next unless values.is_a? Hash | |
values['flights'].to_a.map do |f| | |
f['include'].to_a.map do |i| | |
i.to_h['where'].to_h['referer'] | |
end | |
end | |
end.flatten.uniq.compact | |
puts ir.join(', ') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment