diff --git a/lookyloo/lookyloo.py b/lookyloo/lookyloo.py index e6343763..676f8020 100644 --- a/lookyloo/lookyloo.py +++ b/lookyloo/lookyloo.py @@ -75,9 +75,14 @@ class Lookyloo(): with har_files[0].open() as f: j = json.load(f) title = j['log']['pages'][0]['title'] + timestamp = j['log']['pages'][0]['startedDateTime'] + if j['log']['entries']: + first_url = j['log']['entries'][0]['request']['url'] + else: + first_url = '-' if not title: title = '!! No title found !! ' - cache = {'uuid': uuid, 'title': title} + cache = {'uuid': uuid, 'title': title, 'timestamp': timestamp, 'url': first_url} if (report_dir / 'no_index').exists(): # If the folders claims anonymity cache['no_index'] = 1 if uuid and not self.redis.exists(str(report_dir)): diff --git a/website/3rdparty.sh b/website/3rdparty.sh index ec53fde5..df422a65 100755 --- a/website/3rdparty.sh +++ b/website/3rdparty.sh @@ -10,3 +10,8 @@ wget -q https://d3js.org/d3.v5.min.js -O web/static/d3.v5.min.js FileSaver="v2.0.2" wget -q https://raw.githubusercontent.com/eligrey/FileSaver.js/${FileSaver}/src/FileSaver.js -O web/static/FileSaver.js + +bootstrap_table="1.15.5" + +wget -q https://unpkg.com/bootstrap-table@${bootstrap_table}/dist/bootstrap-table.min.css -O web/static/bootstrap-table.min.css +wget -q https://unpkg.com/bootstrap-table@${bootstrap_table}/dist/bootstrap-table.min.js -O web/static/bootstrap-table.min.js diff --git a/website/web/__init__.py b/website/web/__init__.py index 11e90d5b..ae24ec73 100644 --- a/website/web/__init__.py +++ b/website/web/__init__.py @@ -173,5 +173,8 @@ def index(): cached = lookyloo.report_cache(report_dir) if not cached or 'no_index' in cached: continue - titles.append((cached['uuid'], cached['title'])) + date, time = cached['timestamp'].split('T') + time, _ = time.split('.', 1) + titles.append((cached['uuid'], cached['title'], date, time, cached['url'])) + titles = sorted(titles, key=lambda x: (x[2], x[3]), reverse=True) return render_template('index.html', titles=titles) diff --git a/website/web/static/tree.css b/website/web/static/tree.css index 74e72391..a7f0036e 100644 --- a/website/web/static/tree.css +++ b/website/web/static/tree.css @@ -111,3 +111,9 @@ hr { border-style: inset; border-width: 1px; } + +#timestamp { + text-align: right; + color: gray; + font-size: small; +} diff --git a/website/web/templates/index.html b/website/web/templates/index.html index ffc55174..af195364 100644 --- a/website/web/templates/index.html +++ b/website/web/templates/index.html @@ -1,16 +1,30 @@ {% extends "main.html" %} -{% block title %}Tree{% endblock %} +{% block title %}Lookyloo{% endblock %} {% block content %}
-

Scrape a page

+

Use Lookyloo to scrape a page



-
- {% for uuid, page_title in titles %} - {{ page_title }} -

- {% endfor %} -
+ + + + + + + + + + {% for uuid, page_title, date, time, url in titles %} + + + + + {% endfor %} + +
Page titleInitial URL
+ {{ page_title }} +
{{ date }} {{ time }}
+
{{ url }}
{% endblock %} diff --git a/website/web/templates/main.html b/website/web/templates/main.html index 80f78494..d85c125c 100644 --- a/website/web/templates/main.html +++ b/website/web/templates/main.html @@ -10,21 +10,27 @@ {% block styles %} {{ bootstrap.load_css() }} - + + {% endblock %} - Lookyloo + + {% block title %}{% endblock%} + {% endblock %} - {% block content %}{% endblock%} +
+ {% block content %}{% endblock%} +
{% block scripts %} {{ bootstrap.load_js() }} - + + {% endblock %}