diff options
Diffstat (limited to 'root/$mmm/plugins/twitter')
| -rw-r--r-- | root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon b/root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon new file mode 100644 index 0000000..4821823 --- /dev/null +++ b/root/$mmm/plugins/twitter/converts: text$moonscript -> table.moon @@ -0,0 +1,21 @@ +import div, blockquote, a from require 'mmm.dom' +import iframe from require 'mmm.dom' + +{ + { + inp: 'URL -> twitter/tweet' + out: 'mmm/dom' + cost: -4 + transform: (href) => + user, id = assert (href\match 'twitter.com/([^/]-)/status/(%d*)'), "couldn't parse twitter/tweet URL: '#{href}'" + + iframe { + width: 550 + height: 560 + border: 0 + frameBorder: 0 + allowfullscreen: true + src: "//twitframe.com/show?url=https%3A%2F%2Ftwitter.com%2F#{user}%2F#{id}" + } + } +} |
