# xmlrpc.rb # # XML-RPC API # # Copyright (c) 2004 MoonWolf # Distributed under the GPL2 or any later version. # add_header_proc do %Q!\t\n! end add_conf_proc('XMLRPC', 'XML-RPC API') do saveconf_xmlrpc xmlrpc_init <<-HTML

#{label_xmlrpc_url}

#{label_xmlrpc_blogid}

#{label_xmlrpc_username}

#{label_xmlrpc_password}

#{label_xmlrpc_lastname}

#{label_xmlrpc_firstname}

#{label_xmlrpc_userid}

HTML end # # for conf_proc # def xmlrpc_init @conf['xmlrpc.url'] ||= base_url + 'xmlrpc.rb' @conf['xmlrpc.blogid'] ||= 'devlog' @conf['xmlrpc.username'] ||= 'default' @conf['xmlrpc.password'] ||= '' @conf['xmlrpc.lastname'] ||= '' @conf['xmlrpc.firstname'] ||= 'default' @conf['xmlrpc.userid'] ||= 'default' end def saveconf_xmlrpc if @mode == 'saveconf' then @conf['xmlrpc.url'] = @cgi.params['xmlrpc.url'][0] || 'xmlrpc.rb' @conf['xmlrpc.blogid'] = @cgi.params['xmlrpc.blogid'][0] || 'default' @conf['xmlrpc.username'] = @cgi.params['xmlrpc.username'][0] || 'default' @conf['xmlrpc.password'] = @cgi.params['xmlrpc.password'][0] || '' @conf['xmlrpc.lastname'] = @cgi.params['xmlrpc.lastname'][0] || '' @conf['xmlrpc.firstname'] = @cgi.params['xmlrpc.firstname'][0] || 'default' @conf['xmlrpc.userid'] = @cgi.params['xmlrpc.userid'][0] || 'default' open('rsd.xml','w') {|f| f.write <<-EOS tDiary http://www.tdiary.org/ #{h base_url} EOS } end end # Local Variables: # mode: ruby # indent-tabs-mode: t # tab-width: 3 # ruby-indent-level: 3 # End: