NAME

LJ::GetCookieSession - A perl module to log into livejournal services

VERSION

Version 0.01

SYNOPSIS

LJ::GetSessionCookie is an perl module which is used to generate value of cookie parameter named 'ljsession', which can be used in future requests to lj services.

Request mode sessiongenerate (see http://www.livejournal.com/doc/server/ljp.csp.flat.sessiongenerate.html) is used.

use LJ::GetSessionCookie;

my $ljsession = LJ::GetCookieSession->generate({user=> ..., pass=>...});

http://www.livejournal.com/developer/protocol.bml

EXAMPLE

The following simple shows how to use the module to get all comments from LiveJournal.

	use WWW::Mechanize;
	use LJ::GetCookieSession;
	
	my $mech = WWW::Mechanize->new(
		agent      => 'support@creograf.ru',
		cookie_jar => { "ljsession" => "" }
	);
	
	 my $ljsession = LJ::GetCookieSession->generate({user=> ..., pass=>...});

	die "failed to log into lj: ljsession failed\n" unless ( defined $ljsession );

	$mech->add_header ('X-LJ-Auth' => "cookie");
	$mech->add_header ('Cookie' => "ljsession=$ljsession");

	$mech->get("http://livejournal.com/export_comments.bml?get=comment_body");

    return undef unless ($mech->res->is_success);

	my $xml_comments = $mech->content();

LICENSE AND COPYRIGHT

Copyright 2011 Anastasiya Deeva, Studio Creograf http://creograf.ru, support@creograf.ru

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

AVAILABLE METHODS

LJ::GetSessionCookie::generate()

LJ::GetSessionCookie::generate() is a routine which generates value of cookie 'ljsession' for LiveJournal.

user

The username who owns the journal; this option is required.

pass

The password of the user; this option is required.

server

URL of remote site to login.

BUGS

Please report any bugs or feature requests to bug-lj-getsessioncookie at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LJ-GetSessionCookie. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc LJ::GetSessionCookie

You can also look for information at: