From 78d99a61f6f7915ca67ea57480ae00228d537f52 Mon Sep 17 00:00:00 2001 From: Wouter Scherphof Date: Thu, 21 Mar 2013 14:30:29 +0100 Subject: [PATCH] incomplete test for extraxting microdata See -- TODO --- test.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/test.lua b/test.lua index 9d3ffc9..2dd046e 100644 --- a/test.lua +++ b/test.lua @@ -74,5 +74,21 @@ for k,v in pairs(contacts) do end end +print("\nmicrodata") +local sel, scopes = root("[itemscope]"), {} +for i,v in ipairs(sel.nodes) do + local type = v.attributes["itemtype"] + if not v.attributes["itemprop"] then + scopes[type] = scopes[type] or {} + local item = {} + local sel = sel("[itemprop]") + for i,v in ipairs(sel.nodes) do + -- TODO + print("prop", v.attributes["itemprop"]) + end + table.insert(scopes[type], item) + end +end +