def write_visit_time(self):
        #checks if chrome process is running
        if (check_running_process('chrome')):
            return
        else:
            #connect to chrome history db
            conn = sqlite3.connect(self._history_path)
            c = conn.cursor()
            #get search term results
            c.execute("""SELECT MAX(visit_time) FROM visits""")
            rows = c.fetchall()

            visit_time = rows[0][0]
            conn.commit()
            conn.close()  #close chrome history db

            #chrome log file path
            chrome_log_file = os.path.expanduser(
                '~\Documents\ezPass\Logs\chrome_logs.txt')

            #ezPass logs folder path
            folder_path = os.path.expanduser('~\Documents\ezPass\Logs')
            os.chdir(folder_path)

            str1 = "VISIT_TIME:" + str(visit_time) + "\n"

            with open('chrome_logs.txt', "w") as f:
                f.write(str1)
    def get_title(self):
        #checks if chrome process is running
        if (check_running_process('chrome')):
            return
        else:
            conn = sqlite3.connect(self._history_path)
            c = conn.cursor()
            c.execute(
                """SELECT title FROM urls WHERE id IN 
                            (SELECT url from visits WHERE visit_time > ?)""",
                (self._visit_time, ))
            words = c.fetchall()

            str1 = ""
            for tup in words:
                word = tup[0]
                str1 += word + ' '

            self._keywords.append(str1)

            conn.commit()
            conn.close()
示例#3
0
    def get_title(self):
        #checks if firefox process is running
        if (check_running_process('firefox')):
            return
        else:
            conn = sqlite3.connect(self._history_path)
            c = conn.cursor()
            c.execute(
                """SELECT title FROM moz_places WHERE id IN  
                            (SELECT place_id from moz_historyvisits WHERE visit_date > ?)
                            AND title IS NOT NULL""", (self._visit_time, ))
            words = c.fetchall()

            str1 = ""
            for tup in words:
                word = tup[0]
                str1 += word + ' '

            self._keywords.append(str1)

            conn.commit()
            conn.close()
    def get_keyword_search_terms(self):
        #checks if chrome process is running
        if (check_running_process('chrome')):
            return
        else:
            #connect to chrome history db
            conn = sqlite3.connect(self._history_path)
            c = conn.cursor()
            #get search term results
            c.execute(
                """SELECT normalized_term FROM keyword_search_terms WHERE url_id IN 
                            (SELECT url from visits WHERE visit_time > ?)""",
                (self._visit_time, ))
            words = c.fetchall()

            str1 = ""
            for tup in words:
                word = tup[0]
                str1 += word + ' '

            self._keywords.append(str1)

            conn.commit()
            conn.close()  #close chrome history db