On Fri, Sep 07, 2001 at 01:05:11PM +0200, Ferenc VERES wrote:
> Hello Users and Authors!
>
> On the result page you can have 3 different tilte lines:
> 1. "No title" configurable
> 2. <TITLE></TITLE> value from header
> 3. filename
>
> Since the page header is always the same (same file!) on
> one of our homepage, it would be good to have a custom
> title line, which can be set inside the content of each
> page. Is there a way to do this? For example, if I
> find the first <H3> on the page, that would be great.
I would think of something like this:
NOT TESTED!
htdig may use something like this as external parser for
text/html. --- no, this will not work
(
Is it possible to do something like this:
external_parser: text/html->text/html /usr/local/bin/foobar.pl
where the external parser is only used the first time?
)
----------
#!/usr/bin/perl
my($infile, $content_type, $url, $config) = @ARGV;
undef $/;
open IN, $infile;
$text = <IN>;
close IN;
if( $url=~m#^http://www.special.site.org/#i ){
# find the content of the first h3 tag
$text =~ m#^.*?<h3>(.*?)</h3>#si;
$title = $1;
# edit title tag
$text =~ s#^(.*?<title.*?>).*?(</title>.*$)#$1$title$2#si;
}
print $text; # loop !!!!!!!!!!!!!!
------------
You will have to reimplement the functionality of the internal parser :-(
See the documentation for external_parser.
> If there is no way, I will try to patch it, but I want
> to be sure before trying to make it. Maybe there is a
> config option :-)
>
> I use 3.2.0b3. (without snapshots)
cu, Stefan
--
Stefan Nehlsen | ParlaNet Administration | [EMAIL PROTECTED] | +49 431 988-1260
_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html