Slash Boxes
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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Here's something I've put together as an early example for my chapter on using the toolkits (the one that will introduce each of the SOAP and SOAP::Lite packages, before moving on to bigger code). This'll do until we get "native" RSS feeds of individual journal. :-)

    OK, scratch that. Getting the code to look right in preview is killing me. Instead, pull it down from here []. Pudge, if you tell me how to make my code look purdy like yours, I'll update this...




    • I've been holding off announcing it, but use the pseudotag <ECODE>. It still needs some work, and has some caveats, which I hope to deal with and announce soon.
      • Let's give it a try, then... here 'tis:

        #!/usr/bin/perl -w

        use strict;

        use SOAP::Lite;
        use XML::RSS;

        my $user = shift ||
            die "Usage: $0 userID [ usernick ]\n\nStopped";
        my $nick = shift || "#$user";

        my $host        = '';
        my $uri         = "http://$host/Slash/Journal/SOAP";
        my $proxy       = "http://$host/";

        my $journal = SOAP::Lite->uri($uri)->proxy($proxy);
        my $results = $journal->get_entries($user, 15)->result;
        my $rss     = XML::RSS->new(version => '1.0');

        $rss->channel(title       => " journal of $nick",
                      'link'      => $proxy,
                      description => "The journal of $nick");
        $rss->add_item(title  => $_->{subject}, 'link' => $_->{url})
            for (@$results);

        print STDOUT $rss->as_string;


        (Looks much better in preview, thanks...)