Fearless O'Toole, Last British Columbian Pirate (kimera) wrote in lj_clients,
Fearless O'Toole, Last British Columbian Pirate

  • Mood:


(After mis-posting this to lj_dev...)

Can anyone tell me why (or point me in the right direction to the reason why) the following code...


use LWP 5.64;
use HTTP::Response;
use strict;

my $url = "http://www.livejournal.com/interface/flat";
my $ida;
my $passwd;
my $mode = "login";
my $entry;
my $newline;
my $browser = LWP::UserAgent->new;
my $response;

print "Enter your id: ";
$ida = <STDIN>;

print "Enter your password: ";
$passwd = <STDIN>;

print "Enter your text:\n";
while ($newline ne ".") {
	$newline = <STDIN>;
	$newline =~ s/\n//g;
	$entry = "$entry\r\n$newline";

$ida =~ s/\n//g;
$passwd =~ s/\n//g;
$entry =~ s/([^A-Za-z0-9 ])/sprintf("%%%02lx", unpack("c",$1))/ge;
$entry =~ s/ /+/g;

$response = $browser->post ( $url,
		'mode' => '\"$mode\"',
		'user' => '\"$ida\"',
		'password' => '\"$passwd\"',
		'event' => '\"$entry\"'

print $response->content;


...gives me the following error...

Client error: No username sent.

I've looked at the Developer Area and I can't find a single reason that it can't get the username. I haven't dont the hexcoding for non-alphanumeric characters yet (I have done this at this point), but would that affect the basic post string? I'm not giving up, but I'm lost on where to look next. Any and all help would be appreciated -- and I apologize if this is bad protocol for a first post.

  • 302: lj_dev

    In the interests of consolidating all LiveJournal development-related discussion, we're going to be closing down this community. The same…

  • Plain text to LJ

    I have an old blog from xanga that's in html/plain text and I want to move it over here. Which client would be the best to do this? I also want to…

  • ljKlient 0.2.0 Preview Release 1

    Today marks another milestone in the development of ljKlient — as the first preview of the 0.2 series is released.  Please go to the project…

  • Post a new comment


    Comments allowed for members only

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened