clix.publish_atom: Alter Activitystrea.ms argument prefix to --as- and remove IRI prefixing

Tue, 08 Oct 2013 14:54:05 +0200

author
Kim Alvefur <zash@zash.se>
date
Tue, 08 Oct 2013 14:54:05 +0200
changeset 120
3456a6088dc6
parent 119
d2cb5800ab27
child 121
896a25ed6b1b

clix.publish_atom: Alter Activitystrea.ms argument prefix to --as- and remove IRI prefixing

clix/publish_atom.lua file | annotate | diff | comparison | revisions
--- a/clix/publish_atom.lua	Tue Oct 08 14:45:07 2013 +0200
+++ b/clix/publish_atom.lua	Tue Oct 08 14:54:05 2013 +0200
@@ -3,7 +3,6 @@
 
 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
@@ -38,9 +37,9 @@
 		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();
+			if opt:match"^as%-" then
+				atom_entry:tag(opt:sub(4), { xmlns = xmlns_activitystreams } )
+					:text(optval):up();
 			end
 		end
 

mercurial