Add a bunch of Rael plugins.
[matthijs/upstream/blosxom-plugins.git] / general / rss10
1 # Blosxom Plugin: rss10
2 # Author(s): Rael Dornfest <rael@oreilly.com> 
3 # Version: 2.0b4
4 # Documentation: See the bottom of this file or type: perldoc rss10
5
6 package rss10;
7
8 # --- Configurable variables -----
9
10 # What is your full name?
11 $creator = 'John Jacob Jingleheimer Schmidt';
12
13 # What is your email address?
14 $email = 'jjjs@example';
15
16 # What is your timezone's offset from GMT?
17 $tz_offset = "-08:00"; #PST
18
19 # What placeholder in your flavour tempalte should I replace with <items />?
20 my $template_placeholder = "{{{items}}}";
21
22 # What is your TrackBack implementation's URL (if any)?
23 #$trackback_url = "$blosxom::url/tb.cgi";
24
25 # --- Plug-in package variables -----
26
27 $items;
28 $body;
29 $trackback_ping;
30
31 $generatorAgent = "http://www.raelity.org/apps/blosxom/?v=$blosxom::version";
32
33 $T = 'T';
34 $colon = ":";
35
36 # --------------------------------
37
38 use FileHandle;
39
40 my $fh = new FileHandle;
41
42 sub start {
43   1;
44 }
45
46 sub head {
47   $items = '';
48 }
49
50 sub story {
51   my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
52
53   $body = $$body_ref;
54
55   $trackback_ping = $trackback_url ? qq{<trackback:ping rdf:resource="$trackback_url$path/$filename" />} : '';
56
57   $items .= qq{        <rdf:li rdf:resource="$blosxom::url$path/$filename.html" />\n};
58
59   1;
60 }
61
62 sub foot {
63   my($pkg, $currentdir, $foot_ref) = @_;
64
65   $items = <<"ITEMS";
66     <items>
67       <rdf:Seq>
68 $items
69       </rdf:Seq>
70     </items>
71 ITEMS
72
73   $blosxom::output =~ s/$template_placeholder/$items/m;
74
75   return 1;
76 }
77
78 1;
79
80 __END__
81
82 =head1 NAME
83
84 Blosxom Plug-in: rss10
85
86 =head1 SYNOPSIS
87
88 Purpose: Provides the extra bit of programming needed to produce a valid
89 RSS 1.0 [http://www.purl.org/rss/1.0/] feed for syndication.  Works
90 in concert with the associated {head,story,foot,content_type,date}.rss10 
91 flavour files.
92
93 =head1 VERSION
94
95 2.0b1
96
97 Version number coincides with the version of Blosxom with which the 
98 current version was first bundled.
99
100 =head1 AUTHOR
101
102 Rael Dornfest  <rael@oreilly.com>, http://www.raelity.org/
103
104 =head1 SEE ALSO
105
106 Blosxom Home/Docs/Licensing: http://www.raelity.org/apps/blosxom/
107
108 Blosxom Plugin Docs: http://www.raelity.org/apps/blosxom/plugin.shtml
109
110 =head1 BUGS
111
112 Address bug reports and comments to the Blosxom mailing list 
113 [http://www.yahoogroups.com/group/blosxom].
114
115 =head1 LICENSE
116
117 Blosxom and this Blosxom Plug-in
118 Copyright 2003, Rael Dornfest 
119
120 Permission is hereby granted, free of charge, to any person obtaining a
121 copy of this software and associated documentation files (the "Software"),
122 to deal in the Software without restriction, including without limitation
123 the rights to use, copy, modify, merge, publish, distribute, sublicense,
124 and/or sell copies of the Software, and to permit persons to whom the
125 Software is furnished to do so, subject to the following conditions:
126
127 The above copyright notice and this permission notice shall be included
128 in all copies or substantial portions of the Software.
129
130 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
131 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
132 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
133 THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
134 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
135 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
136 OTHER DEALINGS IN THE SOFTWARE.