Skip to content

Instantly share code, notes, and snippets.

@sergueif
Created May 5, 2014 00:25
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sergueif/1855c538d0a2249125ef to your computer and use it in GitHub Desktop.
Save sergueif/1855c538d0a2249125ef to your computer and use it in GitHub Desktop.
All domains visited by Chrome
#some bash first
#Get Chrome history file here: http://www.chromium.org/user-experience/user-data-directory
#sqlite3 /PATH/TO/History "select datetime(last_visit_time/1000000-11644473600,'unixepoch'),url from urls order by last_visit_time desc" > history_export.txt
f = File.open('./history_export.txt')
e = f.each_line.lazy.map do |l|
next if l =~ /\|file:/
next if l =~ /\|chrome-extension:/
next if l =~ /\|mailto:/
s = l[%r[\|https?://(.*)],1].to_s[%r[(.*?)/],1]
raise l if s.nil?
s
end.to_a.compact.sort.uniq
e.each(&method(:puts))
puts e.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment