All pastes #30886 Raw Edit

InitHello

public text v1 · immutable
#30886 ·published 2005-11-24 08:09 UTC
rendered paste body
	elsif ($what =~ /http:\/\/bash.org\/\?([0-9]+)/i) {
		use HTML::Scrubber;
		my $scrubber = HTML::Scrubber->new( allow => [ qw[ br ] ] );
		my $quotenum = $1;
		print $client "PRIVMSG $where :Quote number $quotenum\n";
		my $rawtext;
		my $bash = IO::Socket::INET->new(PeerAddr => 'bash.org', PeerPort => '80', Proto    => 'tcp');
		print $bash "GET /?$quotenum HTTP/1.0\n\n";
		while (<$bash>) {
			$rawtext .= $_;
		}
		$rawtext =~ s/\n|\r/MAGICMAGIC/g;
		$rawtext =~ s/<\/p>/\n\n/g;
		$rawtext =~ /<p class="qt">(.+)/i;
		my $cleantext = "PRIVMSG $where :$1";
		$cleantext =~ s/<br \/>MAGICMAGIC/\n/g;
		$cleantext =~ s/MAGICMAGIC/PRIVMSG $where :/g;
		$cleantext =~ s/&gt;/>/g;
		$cleantext =~ s/&lt;/</g;
		$cleantext .= "\n";
		print $client $cleantext;	
	}