File: update_rss_1.0.pl

package info (click to toggle)
libxml-rss-perl 1.48-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 756 kB
  • ctags: 231
  • sloc: perl: 6,888; xml: 378; makefile: 2
file content (33 lines) | stat: -rw-r--r-- 918 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/perl -w
# this script adds a new item to an existing rss file and
# updates the channel date and publisher
 
use XML::RSS;

# create a new instance of the XML::RSS
my $rss = XML::RSS->new;

# parse the local file
$rss->parsefile("rss1.0.rdf");

# add a new item to the file
$rss->add_item(
   title       => "QScheme 0.2.2",  
   link        => "http://freshmeat.net/news/1999/06/21/930003829.html",
   description => "Really fast, small and easy to interface Scheme interpreter",
   dc => {
     subject  => "X11/Utilities",
     creator  => "David Allen (s2mdalle at titan.vcu.edu)",
   },
 );

# update the dublin core information for the channel
$rss->channel(dc => {
		 date => "2000-01-01T12:00+00:00",
		 publisher => "Jonathan Eisenzopf (eisen\@xif.com)" 
		    }
             );

# print the new rss file as a string. We could also save it
to a file with the save() routine.
print $rss->as_string;