LJ::GetCookieSession - A perl module to log into livejournal services
Version 0.01
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.
LJ::GetSessionCookie
perl
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
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();
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.
LJ::GetSessionCookie::generate() is a routine which generates value of cookie 'ljsession' for LiveJournal.
LJ::GetSessionCookie::generate()
The username who owns the journal; this option is required.
The password of the user; this option is required.
user
URL of remote site to login.
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.
bug-lj-getsessioncookie at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc LJ::GetSessionCookie
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=LJ-GetSessionCookie
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/LJ-GetSessionCookie
CPAN Ratings
http://cpanratings.perl.org/d/LJ-GetSessionCookie
Search CPAN
http://search.cpan.org/dist/LJ-GetSessionCookie/
To install LJ::GetCookieSession, copy and paste the appropriate command in to your terminal.
cpanm
cpanm LJ::GetCookieSession
CPAN shell
perl -MCPAN -e shell install LJ::GetCookieSession
For more information on module installation, please visit the detailed CPAN module installation guide.