module LJ class Base def initialize(auth) @client = auth end def event(title,body,keywords) options = base_event(title,body,keywords) perform('postevent',options) end def comunity(comynity_name,title,body,keywords) options = base_event(title,body,keywords) options["usejournal"]=comynity_name perform('postevent',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["ver"] = 1 options['username'] = @client.username options['password'] = @client.password options end def base_event(title,body,keywords) options = common_options() options["mode"] = "postevent" options["props"] = {:taglist => keywords} options["subject"] = title options["event"] = body options end end end