# HG changeset patch # User Kim Alvefur # Date 1345220120 -7200 # Node ID 83cd777fb2941c6cdc1530c8bcb0671c887468df # Parent a2214d8213948fe1a24735f3d2fa9e8b75020d6f clix.publish_atom: Add a way to attach Activitystrea.ms metadata to the entry diff -r a2214d821394 -r 83cd777fb294 clix/publish_atom.lua --- a/clix/publish_atom.lua Fri Aug 17 18:14:32 2012 +0200 +++ b/clix/publish_atom.lua Fri Aug 17 18:15:20 2012 +0200 @@ -2,6 +2,8 @@ local datetime = require "util.datetime".datetime; local xmlns_atom = "http://www.w3.org/2005/Atom"; +local xmlns_activitystreams = "http://activitystrea.ms/spec/1.0/"; +local activitystreams_schema_base = "http://activitystrea.ms/schema/1.0/"; return function (opts, arg) if opts.short_help then @@ -40,6 +42,13 @@ atom_entry:tag("content"):text(opts.content):up(); end + for opt, optval in pairs(opts) do + if opt:match"^as_" then + atom_entry:tag(opt:sub(4):gsub("_", "-"), { xmlns = xmlns_activitystreams } ) + :text(activitystreams_schema_base..optval):up(); + end + end + conn.pubsub(opts.service, opts.node):publish(entry_id, nil, atom_entry , function(ok) -- TODO Report success?