clix/publish_atom.lua

changeset 72
0f69e1902f5b
parent 71
075ecfa46484
child 93
8ab81c304073
equal deleted inserted replaced
71:075ecfa46484 72:0f69e1902f5b
23 local entry_id = opts.entry_id or ("clix-"..new_uuid()); 23 local entry_id = opts.entry_id or ("clix-"..new_uuid());
24 local atom_entry = verse.stanza("entry", { xmlns="http://www.w3.org/2005/Atom" }) 24 local atom_entry = verse.stanza("entry", { xmlns="http://www.w3.org/2005/Atom" })
25 :tag("id"):text(entry_id):up(id) 25 :tag("id"):text(entry_id):up(id)
26 :tag("title"):text(opts.title or ""):up() 26 :tag("title"):text(opts.title or ""):up()
27 :tag("updated"):text(opts.updated or datetime()):up(); 27 :tag("updated"):text(opts.updated or datetime()):up();
28 atom_entry:tag("author"):tag("name"):text(opts.author or "Unknown author"):up(); 28 atom_entry:tag("author"):tag("name"):text(opts.author or os.getenv("USER") or "Unknown author"):up();
29 atom_entry:up(); 29 atom_entry:up();
30 if opts.summary then 30 if opts.summary then
31 atom_entry:tag("summary"):text(opts.summary):up(); 31 atom_entry:tag("summary"):text(opts.summary):up();
32 end 32 end
33 33

mercurial