/[Grep]/lib/Grep/Action/AddFeed.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/Grep/Action/AddFeed.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 25 by dpavlin, Sun Feb 18 15:07:03 2007 UTC revision 26 by dpavlin, Mon Feb 19 10:58:27 2007 UTC
# Line 24  sub canonicalize_uri { Line 24  sub canonicalize_uri {
24          my $self = shift;          my $self = shift;
25          my $value = shift;          my $value = shift;
26          warn "uri: $value";          warn "uri: $value";
27          if ($value =~ s/=grep/=%s/) {          if ($value =~ s/\bgrep\b/%s/) {
28                  $self->canonicalization_note( uri => 'Replaced grep with %s' );                  $self->canonicalization_note( uri => 'Replaced grep with %s' );
29          }          }
30          return $value;          return $value;
31  }  }
32    
33    =head2 canonicalize_cookie
34    
35    Remove C<Cookie:> header from beginning and replace EOL with space.
36    
37    =cut
38    
39    # disabled for now
40    sub xx_canonicalize_cookie {
41            my $self = shift;
42            my $value = shift;
43    
44            warn "cookie: $value";
45    
46            $self->canonicalization_note( uri => 'Removed Cookie: header' )
47                    if ($value =~ s/^Cookie:\s+//);
48    
49            $self->canonicalization_note( uri => 'Converted EOL to space' )
50                    if ($value =~ s/[\n\r]/ /gs);
51    
52            return $value;
53    }
54  =head2 take_action  =head2 take_action
55    
56  =cut  =cut
# Line 66  sub take_action { Line 87  sub take_action {
87    
88                  @feeds = map {                  @feeds = map {
89                          my $t = $_;                          my $t = $_;
90                          $t =~ s/=$search_moniker/=%s/;                          $t =~ s/\b$search_moniker\b/%s/;
91                          $t                          $t
92                  } grep(/=$search_moniker/,@feeds);                  } grep(/\b$search_moniker\b/,@feeds);
93    
94                  $self->result->message('Found ' . @feeds . ' feeds, using first one. ' . join(" ", @feeds) );                  $self->result->message('Found ' . @feeds . ' feeds, using first one. ' . join(" ", @feeds) );
95    

Legend:
Removed from v.25  
changed lines
  Added in v.26

  ViewVC Help
Powered by ViewVC 1.1.26