From 269d9986c12e277eb6fd5241f34c027c439f84ae Mon Sep 17 00:00:00 2001 From: s-ol Date: Mon, 28 Mar 2022 15:58:08 +0200 Subject: fix plugins in example root --- .../twitter/converts: text$lua -> table.lua | 25 ++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 root/$mmm/plugins/twitter/converts: text$lua -> table.lua (limited to 'root/$mmm/plugins/twitter') diff --git a/root/$mmm/plugins/twitter/converts: text$lua -> table.lua b/root/$mmm/plugins/twitter/converts: text$lua -> table.lua new file mode 100644 index 0000000..58ce663 --- /dev/null +++ b/root/$mmm/plugins/twitter/converts: text$lua -> table.lua @@ -0,0 +1,25 @@ +local div, blockquote, a +do + local _obj_0 = require('mmm.dom') + div, blockquote, a = _obj_0.div, _obj_0.blockquote, _obj_0.a +end +local iframe +iframe = require('mmm.dom').iframe +return { + { + inp = 'URL -> twitter/tweet', + out = 'mmm/dom', + cost = -4, + transform = function(self, href) + local user, id = assert((href:match('twitter.com/([^/]-)/status/(%d*)')), "couldn't parse twitter/tweet URL: '" .. tostring(href) .. "'") + return iframe({ + width = 550, + height = 560, + border = 0, + frameBorder = 0, + allowfullscreen = true, + src = "//twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2F" .. tostring(user) .. "%2F" .. tostring(id) + }) + end + } +} -- cgit v1.2.3