Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ed reimplementation contest

Name: Anonymous 2009-09-07 11:18

Let's reimplement ed with modern languages!

10 INPUT
20 PRINT "?"
30 GOTO 10

Name: Anonymous 2009-11-26 12:03

>>48
#/usr/bin/perl

use strict;
use utf8;

use Board::Request;
use Board::Errors;

# exports $board object, consumes some parts of @ARGV
use Board::Utilities;

$USAGE_ARGS        = "BOARD [OPTIONS]";
$USAGE_TEXT        = <<HERE;
Scans board for replies cintaining "GNU/Linux*" and replies "linux" to them.
HERE

while(1){
    my @threads=@{ ($board->content(PAGE 0) or {})->{threads} or [] };

    for my $thread(@threads){
        my @posts=@{ $thread->{posts} };
       
        my %replied;
       
        for(reverse @posts){
            my $num=$_->{num};
           
            if($_->{comment}=~/^>>(\d+)\s*linux$/s){
                $replied{$1}=1;
                next;
            }
           
            next unless $_->{comment}=~m!GNU/Linux\*!;
            next if $replied{$num};
           
            $board->post(
                parent        => $_->{parent},
                password    => 'qwerty',
                comment        => ">>$num\nlinux",
            );
           
            print ucfirst $board->errstr,"\n" and next if $board->error;
           
            print "[$_->{num}]\n";
        }
    }
   
    sleep 10;
}

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List