# -*- cperl -*-
package RssC::Filter::Koshiandoh;
use base RssC::Filter;
use strict;
use warnings;

sub new {
    my $class = shift;
    my $this = $class->SUPER::new(@_);
    $this->{skip_until} = '';
    $this;
}

sub interested_p {
    my ($this, $uri) = @_;
    $uri->host eq 'koshiandoh.com';
}

sub filter {
    my ($this, $uri, $line) = @_;

    # 手抜き
    $line =~ tr/0-9,//d;

    my $ad_begin = 'Special Links';
    my $ad_end = "\0" x 256;
    
    if ($this->{skip_until} ne '') {
	if (index($line, $this->{skip_until}) != -1) {
	    $this->{skip_until} = '';
	}
    }
    elsif (index($line, $ad_begin) != -1) {
	$this->{skip_until} = $ad_end;
    }
    else {
	return $line;
    }
    return '';
}

1;
