clix/publish_atom.lua

changeset 95
ea99e6653e18
parent 94
6f038202a502
child 96
a2214d821394
equal deleted inserted replaced
94:6f038202a502 95:ea99e6653e18
19 print("","--summary=\"To be, or not to be: that is the question\""); 19 print("","--summary=\"To be, or not to be: that is the question\"");
20 return 0; 20 return 0;
21 end 21 end
22 local function on_connect(conn) 22 local function on_connect(conn)
23 -- Required: id, title, updated, author (which must have a name) 23 -- Required: id, title, updated, author (which must have a name)
24 local entry_id = opts.entry_id or ("clix-"..new_uuid()); 24 local entry_id = opts.id or new_uuid();
25 local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom}) 25 local atom_entry = verse.stanza("entry", { xmlns = xmlns_atom})
26 :tag("id"):text(entry_id):up(id) 26 :tag("id"):text(entry_id):up(id)
27 :tag("title"):text(opts.title or ""):up() 27 :tag("title"):text(opts.title or ""):up()
28 :tag("updated"):text(opts.updated or datetime()):up(); 28 :tag("updated"):text(opts.updated or datetime()):up();
29 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up(); 29 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up();

mercurial