Editing
Module:EzTumblr
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
local Ez = {} -- Editors: make sure to carefully copy syntax, including the comma at the end of any new entry Ez.tumblrs = { -- WotC staff ["markrosewater"] = { author = "Mark Rosewater", title = "Blogatog" }, ["dougbeyermtg"] = { author = "Doug Beyer", title = "A Voice for Vorthos" }, ["wizardsmagic"] = { author = "Wizards of the Coast", title = "The Official Magic: The Gathering Tumblr" }, -- Other notable MtG tumblrs ["vorthosjay"] = { author = "Jay Annelli", title = "Ask Jay" }, -- Former MtG tumblrs ["tabakrules"] = { author = "Matt Tabak", title = "Snarkham Asylum" }, ["multiverseinreview"] = { author = "Squirle", title = "Multiverse in Review" }, } local ERR_MALFORMED = "Malformed URL" local ERR_UNKNOWN = "Unknown tumblr (use [[Template:TumblrRef]] or add to [[Module:EzTumblr]]?)" local ERR_NOTITLE = "No title in template or URL (missing slug?)" function Ez.getSupportedBlogs() local sorted = {} local out = "" for url, data in pairs(Ez.tumblrs) do table.insert(sorted, url) end table.sort(sorted) for _, url in ipairs(sorted) do out = out .. string.format("* %s.tumblr.com\n", url) end return out end -- Match the bit between the double-slash and the first period in the given URL function Ez.getAuthor(frame) local tumblrAddress = frame.args[1] local subdomain = tumblrAddress:match("^%w+://([^%.]+)") assert(subdomain, ERR_MALFORMED) assert(Ez.tumblrs[subdomain], ERR_UNKNOWN) return Ez.tumblrs[subdomain].author end function Ez.getTitle(frame) local tumblrAddress = frame.args[1] local subdomain = tumblrAddress:match("^%w+://([^%.]+)") assert(subdomain, ERR_MALFORMED) assert(Ez.tumblrs[subdomain], ERR_UNKNOWN) return Ez.tumblrs[subdomain].title end -- Generates a title for the post if not provided and the editor left the human-readable slug on the URL function Ez.createPostTitle(frame) local tumblrAddress = frame.args[1] local slug = tumblrAddress:match("/([%w%-]+)$") assert(slug, ERR_NOTITLE) slug = slug:gsub("^%l", string.upper) slug = slug:gsub("%-", " ") .. "..." return slug end return Ez
Summary:
Please note that all contributions to Magic the Archiving may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Magic the Archiving:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Template used on this page:
Module:EzTumblr/doc
(
edit
)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Module
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information