Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

pudge (1)

pudge
  (email not shown publicly)
http://pudge.net/
AOL IM: Crimethnk (Add Buddy, Send Message)

I run this joint, see?

Journal of pudge (1)

Tuesday February 12, 2002
03:03 PM

This is a test

[ #2824 ]

Please ignore it. I am testing the new SOAP interface for journals, where I can do this:

#!/usr/bin/perl -w
use strict;
use HTTP::Cookies;
use SOAP::Lite;
 
my $host        = 'use.perl.org';
my $uri         = "http://$host/Journal";
my $proxy       = "http://$host/journal.pl";
my $cookie_file = "$ENV{HOME}Netscape Users:Chris Nandor:MagicCookie";
 
# first line is subject
chomp(my $subject = <>);
my $text = join '', <>;
(my $newtext = $text) =~ s/\n/\012/g;  # Local to Unix newlines
 
my $cookie_jar  = HTTP::Cookies::Netscape->new;
$cookie_jar->load($cookie_file);
 
my $journal = SOAP::Lite->uri($uri)
                        ->proxy($proxy, cookie_jar => $cookie_jar);
 
$journal->add_entry($subject, $newtext);
 
# print text back to original window
print $subject, "\n", $text;
 
__END__

w00p!