about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/microformats/parser.clj9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/microformats/parser.clj b/src/microformats/parser.clj
index ba07fcf..e3a244e 100644
--- a/src/microformats/parser.clj
+++ b/src/microformats/parser.clj
@@ -65,6 +65,15 @@
        (apply str)
        str/trim))
 
+(defn get-base-url
+  "Find the base-url of a document."
+  [document]
+  (-> document
+      (html/select [:head :> [:base (html/attr? :href)]])
+      first
+      :attrs
+      :href))
+
 (defn get-value-class
   "Get the value class of elements"
   [elements]