livejournal
livejournal copied to clipboard
Implement posting to alternative server. Allow connecting to server via HTTPS.
Recently there's been a noticeable migration of LiveJournal users to Dreamwidth.org. Dreamwidth supports the same API as Livejournal. This change allows to log into and post to an alternative server that supports this API. It also allows communication via HTTPS if the server url is declared with https schema. Example:
dreamwidth = LiveJournal::Server.new("Dreamwidth", "https://www.dreamwidth.org")
user = LiveJournal::User.new('test', 'test', dreamwidth)
login = LiveJournal::Request::Login.new(user)
login.run
Where's the default, e.g. 'www.livejournal.com' specified?
It's already there
https://github.com/romanbsd/livejournal/blob/master/lib/livejournal/basic.rb#L35
Existing code already has functionality to define a server and user registered on this server, but this information was not actually used when sending requests.
Fixed some issues and rebased.