3 ms·
If anyone wants to turn that user data into a CSV of username,age,karma, run this Ruby script in the folder with all the HTML files in it: Dir['*.html'].each
by petercooper 19y ago
If anyone wants to turn that user data into a CSV of username,age,karma, run this Ruby script in the folder with all the HTML files in it:
Dir['*.html'].each do |user_file|
user_data = File.read(user_file)
user_name = user_file.chomp('.html')
age = user_data[/created:<\/td><td>(\d+)/, 1]
karma = user_data[/karma:<\/td><td>([\d\-]+)/, 1]
puts "#{user_name},#{age},#{karma}"
end