/[safari]/filter.pl
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 /filter.pl

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

revision 1.3 by dpavlin, Mon Dec 15 00:26:57 2003 UTC revision 1.6 by dpavlin, Tue Feb 1 14:34:55 2005 UTC
# Line 29  sub xmlid2file { Line 29  sub xmlid2file {
29          $mode .= "_";          $mode .= "_";
30    
31          my $view;          my $view;
32          if ($href =~ m/view=([^&]+)&/) {          if ($isbn =~ m/_index$/ && $href =~ m/view=([^&]+)&/) {
33                  $isbn .= "_".$1;                  $isbn .= "_".$1;
34          }          }
35    
# Line 63  $html =~ s!(<title>)O'Reilly Network Saf Line 63  $html =~ s!(<title>)O'Reilly Network Saf
63  $html =~ s!<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">!<body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">!s || die "$infile: margins";  $html =~ s!<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">!<body leftmargin="10" topmargin="10" marginwidth="10" marginheight="10">!s || die "$infile: margins";
64  $html =~ s;<a name="toppage">.*<!--Copyright.*?-->;<a name="toppage"></a>;s || die "$infile: surround layout";  $html =~ s;<a name="toppage">.*<!--Copyright.*?-->;<a name="toppage"></a>;s || die "$infile: surround layout";
65    
66  $html =~ s!<td valign="top" class="v2">.*?(<td valign="top" class="v2" align="right">)!$1!s || die "$infile: top buttons";  $html =~ s!<td valign="top" class="v2">.*?(<td valign="top" class="v2" align="right">)!$1!si || warn "$infile: top buttons";
67  $html =~ s!<td valign="top" class="v2"><a target="_new".*?(<td valign="top" class="v2" align="right">)!$1!s || warn "bottom buttons";  $html =~ s!<td valign="top" class="v2"><a target="_new".*?(<td valign="top" class="v2" align="right">)!$1!si || warn "bottom buttons";
68    
69  $html =~ s!<p><b>URL</b>.*$!</body></html>!s || die "$infile: footer";  $html =~ s!<p><b>URL</b>.*$!</body></html>!si || die "$infile: footer";
70    
71  $html =~ s;<!--.+?-->;;gs;  $html =~ s;<!--.+?-->;;gs;
72    
# Line 75  $html =~ s!(<a\s+[^>]*href=")([^"]+)("[^ Line 75  $html =~ s!(<a\s+[^>]*href=")([^"]+)("[^
75  $html =~ s!<a target="_new"[^>]*href="http://[^>]+>(.+?)</a>!$1!gs;  $html =~ s!<a target="_new"[^>]*href="http://[^>]+>(.+?)</a>!$1!gs;
76    
77  $html =~ s!<img[^>]+Buy Print Version[^>]+>!!gs;  $html =~ s!<img[^>]+Buy Print Version[^>]+>!!gs;
78    $html =~ s!<a[^>]+onclick="OpenWin[^>]+mode=downloadPDF[^>]+>\s*<img[^>]+Download this chapter[^>]+>\s*</a>!!gs;
79    
80  open(OUT,"> $outfile") || die "$outfile: $!";  open(OUT,"> $outfile") || die "$outfile: $!";
81  print "$outfile\n";  print "$outfile\n";

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.6

  ViewVC Help
Powered by ViewVC 1.1.26