Szerkesztő:UTF46/src/generator/lint.pm

generator/lint.pm forráskódja szerkesztés

package generator::lint;
use utf8;
use strict;
use warnings;
use LWP::UserAgent;

sub new {bless {},shift};

sub automata {
	my $self=shift;
	return 1;
};

sub botlist {
	my $self=shift;
	my $lint_id=shift;
	$self->{lint_id}=$lint_id;
	my $ua=LWP::UserAgent->new;
	my $url='https://checkwiki.toolforge.org/cgi-bin/checkwiki.cgi?project=huwiki&view=bots&id='.$lint_id.'&offset=0';
	my $response=$ua->get($url);
	if ($response->is_success) {
		# NOP
	} else {
		die "Failed";
	};
	my $botlist=$response->decoded_content;
bot::debug($botlist);
	if ($botlist =~ /\<pre\>\s+(.+)\s+\<\/pre\>/s) {
		$botlist=$1;
	} else {
		die "unexpected";
	};
	my @titles=split(/\n/,$botlist);
	
	return map {(
		{
			title=>$_,
			lint_id=>$lint_id,
		}
	)} @titles[0..10];
};


sub todolist {
	my $self=shift;
	die "ABSTRACT";	
	
};

1;

en:WTFPL