2014-06-06 21:12:59 +00:00
|
|
|
import sqlite3
|
|
|
|
import shutil
|
2014-06-06 21:21:34 +00:00
|
|
|
import os
|
2014-06-06 21:12:59 +00:00
|
|
|
|
|
|
|
class Chrome:
|
|
|
|
@staticmethod
|
|
|
|
def search(urls, config_folder_path):
|
2014-06-06 21:21:34 +00:00
|
|
|
Chrome.setup(config_folder_path)
|
|
|
|
conn = sqlite3.connect('/tmp/hackertray.chrome')
|
2014-06-06 21:12:59 +00:00
|
|
|
db = conn.cursor()
|
|
|
|
result = []
|
|
|
|
for url in urls:
|
|
|
|
db_result = db.execute('SELECT url from urls WHERE url=:url',{"url":url})
|
|
|
|
if(db.fetchone() == None):
|
|
|
|
result.append(False)
|
|
|
|
else:
|
|
|
|
result.append(True)
|
2014-06-06 21:21:34 +00:00
|
|
|
os.remove('/tmp/hackertray.chrome')
|
2014-06-06 21:12:59 +00:00
|
|
|
return result
|
|
|
|
@staticmethod
|
2014-06-06 21:21:34 +00:00
|
|
|
def setup(config_folder_path):
|
2014-06-06 21:12:59 +00:00
|
|
|
shutil.copyfile(config_folder_path+'/History', '/tmp/hackertray.chrome')
|