mirror of https://github.com/captn3m0/hackertray
Uses constants in chrome config
parent
d9e6e51722
commit
c7a1c653d9
|
@ -5,11 +5,12 @@ import os
|
|||
import sys
|
||||
|
||||
class Chrome:
|
||||
HISTORY_TMP_LOCATION = '/tmp/hackertray.chrome'
|
||||
@staticmethod
|
||||
def search(urls, config_folder_path):
|
||||
Chrome.setup(config_folder_path)
|
||||
conn = sqlite3.connect('/tmp/hackertray.chrome')
|
||||
db = conn.cursor()
|
||||
conn = sqlite3.connect(Chrome.HISTORY_TMP_LOCATION)
|
||||
db = conn.cursor()
|
||||
result = []
|
||||
for url in urls:
|
||||
db_result = db.execute('SELECT url from urls WHERE url=:url',{"url":url})
|
||||
|
@ -17,7 +18,7 @@ class Chrome:
|
|||
result.append(False)
|
||||
else:
|
||||
result.append(True)
|
||||
os.remove('/tmp/hackertray.chrome')
|
||||
os.remove(Chrome.HISTORY_TMP_LOCATION)
|
||||
return result
|
||||
@staticmethod
|
||||
def setup(config_folder_path):
|
||||
|
@ -25,4 +26,4 @@ class Chrome:
|
|||
if not os.path.isfile(file_name):
|
||||
print("ERROR: ", "Could not find Chrome history file", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
shutil.copyfile(file_name, '/tmp/hackertray.chrome')
|
||||
shutil.copyfile(file_name, Chrome.HISTORY_TMP_LOCATION)
|
||||
|
|
Loading…
Reference in New Issue