Skip to content

Commit

Permalink
data_importer: country names from download server
Browse files Browse the repository at this point in the history
avoid request limits on the API server
  • Loading branch information
bergey committed Dec 12, 2023
1 parent fc59584 commit 91cf390
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/phonelib/data_importer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def import_country_names

require 'open-uri'
require 'csv'
io = open('http://api.geonames.org/countryInfoCSV?username=demo&style=full')
io = open('https://download.geonames.org/export/dump/countryInfo.txt')
csv = CSV.new(io, {col_sep: "\t"})
csv.each do |row|
next if row[0].nil? || row[0].start_with?('#') || row[0].empty? || row[0].size != 2
Expand Down

0 comments on commit 91cf390

Please sign in to comment.