lib/lj/base.rb in lj-0.1.0 vs lib/lj/base.rb in lj-0.2.0
- old
+ new
@@ -4,18 +4,18 @@
def initialize(auth)
@client = auth
end
def event(title,body,keywords)
- options = base_event
+ options = base_event(title,body,keywords)
perform('postevent',options)
end
def comunity(comynity_name,title,body,keywords)
- options = base_event
+ options = base_event(title,body,keywords)
options["usejournal"]=comynity_name
- perform('perform',options)
+ perform('postevent',options)
end
private
@@ -24,25 +24,26 @@
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["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
+ def base_event(title,body,keywords)
options = common_options()
- options["mode"]="postevent"
- options["lineendings"]=keywords
- options["subject"]=title
- options["event"]=body
+ options["mode"] = "postevent"
+ options["props"] = {:taglist => keywords}
+ options["subject"] = title
+ options["event"] = body
options
end
end
end