module LJ class Base def initialize(auth) @client = auth end def event(title,body,keywords) options = base_event perform('postevent',options) end def comunity(comynity_name,title,body,keywords) options = base_event options["usejournal"]=comynity_name perform('perform',options) end private def perform(function, options={}) LJ::Request.perform(function, options) end def common_options t=Time.now options = {} options["year"]=t.year options["mon"]=t.mon options["day"]=t.day options["hour"]=t.hour options["min"]=t.min options['username'] = @client.username options['password'] = @client.password options end def base_event options = common_options() options["mode"]="postevent" options["lineendings"]=keywords options["subject"]=title options["event"]=body options end end end