Initial commit

This commit is contained in:
2025-01-25 19:04:20 -06:00
commit d556823350
10 changed files with 334 additions and 0 deletions

18
app/browser.py Normal file
View File

@@ -0,0 +1,18 @@
from datetime import datetime
from typing import List, Tuple
from browser_history import get_history, get_bookmarks
from urllib.parse import urlparse
class BrowserHistoryCollector:
@staticmethod
def get_domain(url: str) -> str:
return urlparse(url).netloc
def fetch_history(self) -> List[Tuple[datetime, str, str]]:
outputs = get_history()
# Returns list of tuples containing (datetime, url, title)
return [(entry[0], entry[1], entry[2]) for entry in outputs.histories]
def fetch_bookmarks(self) -> List[Tuple[datetime, str, str, str]]:
outputs = get_bookmarks()
return outputs.bookmarks