line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# $Id: /mirror/perl/GunghoX-FollowLinks/trunk/lib/GunghoX/FollowLinks/Rule/Fresh/Memory.pm 31640 2007-12-01T15:48:28.904993Z daisuke $ |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# Copyright (c) 2007 Daisuke Maki <daisuke@endeworks.jp> |
4
|
|
|
|
|
|
|
# All rights reserved. |
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
package GunghoX::FollowLinks::Rule::Fresh::Memory; |
7
|
1
|
|
|
1
|
|
586
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
26
|
|
8
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
105
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub new |
11
|
|
|
|
|
|
|
{ |
12
|
1
|
|
|
1
|
1
|
1
|
my $class = shift; |
13
|
1
|
|
|
|
|
3
|
return bless { seen => {} }, $class; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub put |
17
|
|
|
|
|
|
|
{ |
18
|
1
|
|
|
1
|
1
|
4
|
my ($self, $url) = @_; |
19
|
1
|
|
|
|
|
3
|
$self->{seen}{$url}++; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub get |
23
|
|
|
|
|
|
|
{ |
24
|
3
|
|
|
3
|
1
|
73
|
my ($self, $url) = @_; |
25
|
3
|
|
|
|
|
12
|
return $self->{seen}{$url}; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 NAME |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
GunghoX::FollowLinks::Rule::Fresh::Memory - Store URLs In Memory |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHODS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 new |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head2 put |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=head2 get |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=cut |