diff --git a/digimarks.py b/digimarks.py index 7d323b2..a19d6b7 100644 --- a/digimarks.py +++ b/digimarks.py @@ -203,6 +203,10 @@ class Bookmark(db.Model): else: return None + def get_uri_domain(self): + parsed = urlparse(self.url) + return parsed.hostname + @classmethod def strip_url_params(cls, url): parsed = urlparse(url) diff --git a/templates/bookmarks.html b/templates/bookmarks.html index 6f031d7..ad4ce12 100644 --- a/templates/bookmarks.html +++ b/templates/bookmarks.html @@ -107,7 +107,7 @@ {% if bookmark.title %} {{ bookmark.title }} {% else %} - [ no title ] + {{ bookmark.get_uri_domain() }} (no title) {% endif %}