hail2u / blosxom-plugins

various plugin for blosxom 2.x

This URL has Read+Write access

blosxom-plugins / excerpt
100644 33 lines (22 sloc) 0.559 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Blosxom Plugin: excerpt
# Author(s): Kyo Nagashima <kyo@hail2u.net>
# Version: 2004-05-20
# Blosxom Home/Docs/Licensing: http://www.blosxom.com/
 
package excerpt;
 
use strict;
use vars qw($body);
 
# --- Configurable variables -----------
 
# --- Plug-in package variables --------
 
# --------------------------------------
 
sub start {
  return 1;
}
 
sub story {
  my($pkg, $path, $fn, $story_ref, $title_ref, $body_ref) = @_;
 
  $body = $$body_ref;
  $body =~ s!\x0D|\x0A!!g;
  $body =~ s!^.*?<p>(.*?)</p>.*?$!$1!;
  $body =~ s!<.*?>!!g;
 
  return 1;
}
 
1;