add a helper script to update github_usernames.txt file in data dir from github poc json data we have stored in our db

This commit is contained in:
Brendan McDevitt 2022-04-13 10:45:50 -05:00
parent 81b290595d
commit 5e3e210f41

View file

@ -0,0 +1,13 @@
class GithubUsernamesPopulate
def self.usernames_from_pocs
GithubPoc.pluck(:owner).map {|h| h['login']}.sort.uniq
end
def self.update_file
fp = '/data_importer/data/github_usernames.txt'
File.open(fp, "w+") do |f|
puts "Updating username file found at #{fp}"
f.puts(usernames_from_pocs)
end
end
end