~ubuntu-branches/ubuntu/trusty/swish-e/trusty

« back to all changes in this revision

Viewing changes to prog-bin/spider.pl.in

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Drolez
  • Date: 2009-11-05 16:23:33 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20091105162333-9xf7dmhhhvt97bvw
Tags: 2.4.7-1
* New upstream release
* Added Japanese and Russian debconf translations. Closes: #543187, #512987

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# This is set to where Swish-e's "make install" installed the helper modules.
5
5
use lib ( '@@perlmoduledir@@' );
6
6
 
7
 
# $Id: spider.pl.in,v 1.26 2007/01/12 21:11:49 whmoseley Exp $
 
7
# $Id: spider.pl.in 1900 2007-02-07 17:28:56Z moseley $
8
8
#
9
9
# "prog" document source for spidering web servers
10
10
#
35
35
use HTML::Tagset;
36
36
 
37
37
use vars '$VERSION';
38
 
$VERSION = sprintf '%d.%02d', q$Revision: 1.26 $ =~ /: (\d+)\.(\d+)/;
 
38
$VERSION = sprintf '%d.%02d', q$Revision: 1900 $ =~ /: (\d+)\.(\d+)/;
39
39
 
40
40
use vars '$bit';
41
41
use constant DEBUG_ERRORS   => $bit = 1;    # program errors
1995
1995
want to specify the port name in the the list of hosts in C<same_hosts>:
1996
1996
 
1997
1997
    my %serverA = (
1998
 
        base_url    => 'http://sunsite.berkeley.edu:4444/',
1999
 
        same_hosts  => [ qw/www.sunsite.berkeley.edu:4444/ ],
 
1998
        base_url    => 'http://mytest.site.invalid:4444/',
 
1999
        same_hosts  => [ qw/www.mytest.site.invalid:4444/ ],
2000
2000
        email       => 'my@email.address',
2001
2001
    );
2002
2002
 
2018
2018
For example, to extract tags from C<a> tags and from C<frame> tags:
2019
2019
 
2020
2020
    my %serverA = (
2021
 
        base_url    => 'http://sunsite.berkeley.edu:4444/',
2022
 
        same_hosts  => [ qw/www.sunsite.berkeley.edu:4444/ ],
 
2021
        base_url    => 'http://mytest.site.invalid:4444/',
 
2022
        same_hosts  => [ qw/www.mytest.site.invalid:4444/ ],
2023
2023
        email       => 'my@email.address',
2024
2024
        link_tags   => [qw/ a frame /],
2025
2025
    );
2348
2348
that the configuration parameters are stored in a perl I<hash>.
2349
2349
 
2350
2350
    my %serverA = (
2351
 
        base_url    => 'http://sunsite.berkeley.edu:4444/',
2352
 
        same_hosts  => [ qw/www.sunsite.berkeley.edu:4444/ ],
 
2351
        base_url    => 'http://mytest.site.invalid:4444/',
 
2352
        same_hosts  => [ qw/www.mytest.site.invalid:4444/ ],
2353
2353
        email       => 'my@email.address',
2354
2354
        link_tags   => [qw/ a frame /],
2355
2355
    );
2361
2361
}
2362
2362
 
2363
2363
    my %serverA = (
2364
 
        base_url    => 'http://sunsite.berkeley.edu:4444/',
2365
 
        same_hosts  => [ qw/www.sunsite.berkeley.edu:4444/ ],
 
2364
        base_url    => 'http://mytest.site.invalid:4444/',
 
2365
        same_hosts  => [ qw/www.mytest.site.invalid:4444/ ],
2366
2366
        email       => 'my@email.address',
2367
2367
        link_tags   => [qw/ a frame /],
2368
2368
        test_url    => \&foo,  # a reference to a named subroutine
2371
2371
Or the subroutine can be coded right in place:
2372
2372
 
2373
2373
    my %serverA = (
2374
 
        base_url    => 'http://sunsite.berkeley.edu:4444/',
2375
 
        same_hosts  => [ qw/www.sunsite.berkeley.edu:4444/ ],
 
2374
        base_url    => 'http://mytest.site.invalid:4444/',
 
2375
        same_hosts  => [ qw/www.mytest.site.invalid:4444/ ],
2376
2376
        email       => 'my@email.address',
2377
2377
        link_tags   => [qw/ a frame /],
2378
2378
        test_url    => sub { reutrn 1; },
2781
2781
 
2782
2782
Send all questions to the The SWISH-E discussion list.
2783
2783
 
2784
 
See http://sunsite.berkeley.edu/SWISH-E.
 
2784
See http://swish-e.org/
2785
2785
 
2786
2786
=cut
2787
2787