Class: SocialPoster::Poster::LiveJournal

Inherits:
Object
  • Object
show all
Includes:
Helper
Defined in:
lib/social_poster/poster/live_journal.rb

Instance Method Summary collapse

Methods included from Helper

#config_key

Constructor Details

#initializeLiveJournal

Returns a new instance of LiveJournal.



9
10
11
12
# File 'lib/social_poster/poster/live_journal.rb', line 9

def initialize
  @user = ::LiveJournal::User.new(config_key(:user), config_key(:password))
  ::LiveJournal::Request::Login.new(@user).run
end

Instance Method Details

#write(text, title) ⇒ Object



14
15
16
17
18
19
# File 'lib/social_poster/poster/live_journal.rb', line 14

def write(text, title)
  lj = ::LiveJournal::Entry.new
  lj.subject = title
  lj.event = text
  ::LiveJournal::Request::PostEvent.new(@user, lj).run
end