# HG changeset patch # User Kim Alvefur # Date 1345220024 -7200 # Node ID 6f038202a502ff109ec4490d2e6ef5bb20750e78 # Parent 8ab81c304073f0c8fd2b6e9602f5e33fbf156904 clix.publish_atom: Move xmlns into a variable diff -r 8ab81c304073 -r 6f038202a502 clix/publish_atom.lua --- a/clix/publish_atom.lua Fri Aug 17 17:29:21 2012 +0200 +++ b/clix/publish_atom.lua Fri Aug 17 18:13:44 2012 +0200 @@ -1,6 +1,8 @@ local new_uuid = require "util.uuid".generate; local datetime = require "util.datetime".datetime; +local xmlns_atom = "http://www.w3.org/2005/Atom"; + return function (opts, arg) if opts.short_help then print("Publish an Atom entry to a pubsub node"); @@ -20,7 +22,7 @@ local function on_connect(conn) -- Required: id, title, updated, author (which must have a name) local entry_id = opts.entry_id or ("clix-"..new_uuid()); - local atom_entry = verse.stanza("entry", { xmlns="http://www.w3.org/2005/Atom" }) + local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom}) :tag("id"):text(entry_id):up(id) :tag("title"):text(opts.title or ""):up() :tag("updated"):text(opts.updated or datetime()):up();