Leser: 2
![]() |
|< 1 2 >| | ![]() |
15 Einträge, 2 Seiten |
1
2
3
4
5
6
<item>
<title>Hier steht ein Title </title>
<link>http://localhost/link.html </link>
<description>Hier ist eine Beschreibung</description>
<text>blablub</text>
</item>
QuoteExtending RSS
...
RSS 2.0 adds that capability, following a simple rule. A RSS feed may contain elements not described on this page, only if those elements are defined in a namespace.
QuoteSection 3: Creating Custom Attributes
...
<g:image_link>http://www.google.com/images/google_sm.gif</g:image_link>
<g:expiration_date>2005-11-15</g:expiration_date>
<g:job_function>Analyst</g:job_function>
...
QuoteWozu willst du das <text> hinzufügen?
Du kannst dich alles, was Text oder HTML ist, in <description> packen!?
Quotealternativ könntest du ausprobieren, das XML mit templates zu genrieren,
z.b. mit CPAN: HTC.
1
2
3
4
5
6
7
8
9
10
11
$rss->add_module(prefix=>'my', uri=>'http://purl.org/my/rss/module/');
$rss->add_item(
title => "xIrc 2.4pre2"
link => "http://freshmeat.net/projects/xirc/",
description => "xIrc is an X11-based IRC client which ...",
my => {
rating => "A+",
category => "X11/IRC",
},
);
1
2
3
4
5
6
7
8
9
10
11
$rss->add_module(prefix=>'my', uri=>'http://purl.org/my/rss/module/');
$rss->add_item(
title => "xIrc 2.4pre2"
link => "http://freshmeat.net/projects/xirc/",
description => "xIrc is an X11-based IRC client which ...",
my => {
rating => "A+",
category => "X11/IRC",
},
);
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/perl
use strict;
use warnings;
use XML::RSS;
my $rss = new XML::RSS (version => '2.0');
$rss->channel(
title => 'freshmeat.net',
link => 'http://freshmeat.net',
description => 'the one-stop-shop for all your Linux software needs',
);
print $rss->as_string;
1
2
3
4
5
6
7
8
9
10
11
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
<channel>
<title>freshmeat.net</title>
<link>http://freshmeat.net</link>
<description>the one-stop-shop for all your Linux software needs</description>
</channel>
</rss>
<rss version="2.0" xmlns:blogChannel="http://backend.userland.com/blogChannelModule">
![]() |
|< 1 2 >| | ![]() |
15 Einträge, 2 Seiten |