mastodon-unfurl.love/0051-ml_from_url

6 lines
295 B
Plaintext

ml_from_url = function(url)
local host, user, id = url:match('^([^/]*://[^/]*)/@([^/]*)/(%d*)$')
if host then return {host=host, user=user, id=id} end
local host, user, id = url:match('^([^/]*://[^/]*)/users/([^/]*)/statuses/(%d*)$')
if host then return {host=host, user=user, id=id} end
end