#!/usr/bin/env ruby # # post something to an annotea server... # # this lives at http://www.w3.org/2001/sw/Europe/200209/annodemo/annomake.rb # $Id: annomake.rb,v 1.3 2002/10/18 18:09:23 charles Exp $ # # License: This software is covered by the W3C Software License. # See http://www.w3.org/Consortium/Legal/copyright-software for details # # Usage: annotate [ []] # # Output: RDF for an annotation on that points to # # todo: interpret options # Should test whether the annotation is an available body # or should be passed to the server as content for an annotations # Error Checking # Make this into a class # use options # # interpret the command line target = ARGV[0] body = ARGV[1] creator = (ARGV[2] || 'Anonymous Coward') type = (ARGV[3] || 'Comment') # collect the rest of the data theTime = Time.now.gmtime now = theTime.strftime("%Y-%m-%dT%H:%MZ") # now = Time.gm.now.strftime("%Y-%m-%dT%H:%MZ") target =~ /([^#]+)(#.*)$/ resource = $1 frag_ID = $2 if frag_ID context = resource + frag_ID else context = resource = target end # output RDF puts '' puts ' ' puts ' ' puts ' ' puts ' ' puts ' ' puts " #{creator}" puts " #{now}" puts " #{now}" puts ' ' puts ' ' puts ''