1 # This module is a plugin for WWW::Scraper, and allows one to search
2 # google, and is released under the terms of the GPL version 2, or any
3 # later version. See the file README and COPYING for more
4 # information. Copyright 2002 by Don Armstrong <don@donarmstrong.com>.
13 use vars qw($VERSION $DEBUG);
17 $VERSION = q($Rev: $);
21 my ($bug_num,$options) = @_;
25 if ( not $bug_num =~ /^\#?\d+$/ ) {
26 warn "Bug is not a number!" and return undef
27 if not $options->{return_warnings};
28 return "Bug is not a number!";
31 my $soap = SOAP::Lite->url->('Debbugs/SOAP/1')->
32 proxy('http://bugs.debian.org/cgi-bin/soap.cgi');
33 $soap->transport->env_proxy();
34 my $result = $soap->get_status(bug => $bug_num)->result();
35 if (not defined $result) {
36 return "No such bug (or some kind of error)";
39 $bug->{num} = $result->{bug_num};
40 $bug->{title} = $result->{subject};
41 $bug->{severity} = $result->{severity}; #Default severity is normal
42 # Just leave the leter instead of the whole thing.
43 $bug->{severity} =~ s/^(.).+$/$1/;
44 $bug->{package} = $result->{package};
45 $bug->{reporter} = $result->{submitter};
46 $bug->{date} = $result->{date};
47 $bug->{tags} = $result->{keywords};
48 $bug->{done} = defined $result->{done} and length $result->{done};
49 $bug->{merged_with} = $result->{mergedwith};
53 $report .= 'DONE:' if defined $bug->{done} and $bug->{done};
56 . uc( $bug->{severity} ) . '['
57 . $bug->{package} . '] '
59 $report .= ' (' . $bug->{tags} . ')' if defined $bug->{tags};
60 $report .= '; ' . $bug->{date};
62 # Avoid reporting so many merged bugs.
64 . join( ',', splice( @{ [ split( /,/, $bug->{merged_with} ) ] }, 0, 3 ) )
66 if defined $bug->{merged_with};
79 # vim:ts=4:sw=4:expandtab:tw=80