Skip to content

Commit e465f96

Browse files
committed
Added feature to analyze history without closing chrome
1 parent c947836 commit e465f96

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

HistoryAnalyzer.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import operator
44
from collections import OrderedDict
55
import matplotlib.pyplot as plt
6+
import shutil
67

78
def parse(url):
89
try:
@@ -33,7 +34,14 @@ def analyze(results):
3334
data_path = os.path.expanduser('~')+"\AppData\Local\Google\Chrome\User Data\Default"
3435
files = os.listdir(data_path)
3536

36-
history_db = os.path.join(data_path, 'history')
37+
# path to user's temp files
38+
temp_path = os.path.expanduser('~')+"\AppData\Local\Temp"
39+
40+
# create a copy of history database in temp
41+
shutil.copyfile(os.path.join(data_path, 'History'),os.path.join(temp_path,'History.db'))
42+
43+
# connect to the copy of history database
44+
history_db = os.path.join(temp_path,'History.db')
3745

3846
#connection
3947
c = sqlite3.connect(history_db)

0 commit comments

Comments
 (0)