clix/publish_atom.lua

changeset 112
9c4b996bdfd8
parent 111
ab7e4845b6c1
child 113
8c9ab9920c79
equal deleted inserted replaced
111:ab7e4845b6c1 112:9c4b996bdfd8
22 end 22 end
23 local function on_connect(conn) 23 local function on_connect(conn)
24 -- Required: id, title, updated, author (which must have a name) 24 -- Required: id, title, updated, author (which must have a name)
25 local entry_id = opts.id or new_uuid(); 25 local entry_id = opts.id or new_uuid();
26 local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom}) 26 local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom})
27 :tag("id"):text(entry_id):up(id) 27 :tag("id"):text(entry_id):up()
28 :tag("title"):text(opts.title or ""):up() 28 :tag("title"):text(opts.title or ""):up()
29 :tag("updated"):text(opts.updated or datetime()):up(); 29 :tag("updated"):text(opts.updated or datetime()):up();
30 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up(); 30 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up();
31 atom_entry:up(); 31 atom_entry:up();
32 atom_entry:tag("source") 32 atom_entry:tag("source")

mercurial