Evan Martin (evan) wrote in lj_clients,
Evan Martin

Ruby module for LiveJournal

I wrote this a while ago, but never had a use for it so I never published it.

This is a LiveJournal module for the language Ruby, which is a sort of cross between Smalltalk and Perl but is more often compared to Python.

It currently only wraps a subset of the LiveJournal protocol, but adding to it should be trivial because the framework is in place.

Or, read the unfinished docs.

Here is some sample code, which dumps your friend-of list and demonstrates some objects:

require 'livejournal'

user = LiveJournal::User.new('test', 'test')
req = LiveJournal::Request::FriendOfs.new(user)
friendofs = req.run()
friendofs.each {|friend|
  puts "#{friend.fullname} (#{friend.username})"

Hopefully it's self-explanatory. :)
  • Post a new comment


    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

  • 1 comment