Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'curb'
- def get_adserver_list_as_array_of_strings
- begin
- body_str = Curl.get("http://pgl.yoyo.org/as/serverlist.php?hostformat=hosts
- &showintro=0&startdate%5Bday%5D=&startdate%5Bmonth%5D
- =&startdate%5Byear%5D=&mimetype=plaintext").body_str
- rescue
- retry
- end
- matches = body_str.scan(/127.0.0.1 (.+)/).to_a
- matches_clean = Array.new
- matches.each { |m| matches_clean.push(m[0]) }
- return matches_clean
- end
- $adservers_array = get_adserver_list_as_array_of_strings
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement