Cos`è RSS

Transcript

Cos`è RSS
Le tecnologie del Web 2.0: RSS
Prof. Filippo Lanubile
Cos’è RSS
• Really Simple Syndication
– ovvero: semplice diffusione di contenuti
• Formato di dati per distribuire agli utenti web gli
aggiornamenti di siti web, dei blog, l'audio dei
podcast o qualsiasi altro tipo di informazione
– E’ diventato un meccanismo di notifica per
applicazioni web
• Basato su XML
– Validatore W3C: http://validator.w3.org/feed/
• La lista delle notifiche è prodotta
periodicamente su file RSS, detti RSS feeds
Prof. Filippo Lanubile
1
RSS: architettura
Prof. Filippo Lanubile
RSS: struttura base
Il feed
coincide con
il sito web
la notizia
Prof. Filippo Lanubile
2
Il feed di un blog (1/2)
<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
<title>Inside Open Source</title>
<link>http://opensource.apress.com/ </link>
<item>
<title>Killer Firefox Tip #294</title>
<link>http://opensource.apress.com/ article/190/</link>
<author>W. Jason Gilmore</author>
<description>Like most of you, I spend bunches of time downloading large
files from the Web
Web, typically podcasts and PDF documents...</description>
documents </description>
</item>
<item>
<title>Beginning Ubuntu Linux wins Linux Journal Award!</title>
<link>http://opensource.apress.com/ article/189/</link>
Prof. Filippo Lanubile
Il feed di un blog (2/2)
<author>Keir Thomas</author>
<description>Woo hoo! My book, Beginning Ubuntu Linux, has won an award
in the Linux Journal Editor's Choice 2006 awards!
More precisely...</description>
</item>
<item>
<title>Forms Validation with CakePHP</title>
<link>http://opensource.apress.com/ article/188/</link>
<author>W. Jason Gilmore</author>
<description>Neglecting
description Neglecting to validate user input is akin to foregoing
any defensive
gameplan for containing the NFL's leading rusher. Chances are
sooner or later...</description>
</item>
</channel>
</rss>
Prof. Filippo Lanubile
3
RSS: storia
• 1999
– Netscape crea la prima versione, 0.90 (Reach Site
S
Syndication),
) seguita dalla 0.91 e altre 0.9x
• 2000
– Versione 1.0 (RDF Site Summary) basata su RDF e
gestito dal RSS-DEV working group
• 2002
– Dave Winer, Harvard University, crea RSS 2.0
(Really Simple Syndication)
• 2005
– Atom 1.0 sponsorizzato da IETF
Prof. Filippo Lanubile
RSS 0.92
<rss version="0.92">
<item>
<channel>
<title>1 < 2</title>
<title>Example Channel</title>
<link>http://example.com/1_less_than_
<link>http://example.com/</link>
2 html</link>
2.html</link>
<description>an example
<description>1
< 2, 3 < 4.
feed</description>
In HTML, <b> starts a bold phrase
<language>en</language>
and you start a link with <a href=
<rating>(PICS-1.1
"http://www.classify.org/safesurf/" l r
</description>
(SS~~000 1))</rating>
</item>
<textInput>
</channel>
<title>Search this site:</title>
</rss>
<description>Find:</description>
<name>q</name>
<link>http://example.com/search</link>
</textInput>
<skipHours>
<hour>24</hour>
</skipHours>
Prof. Filippo Lanubile
4
RSS 1.0
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdfsyntax-ns#"
xmlns="http://purl.org/rss/1.0/">
<channel>
<title>Example Dot Org</title>
<link>http://www.example.org</link>
<description>the Example Organization web
site</description>
<items>
<rdf:Seq>
<rdf:li
resource="http://www.example.org/status/"/>
</rdf:Seq>
/ df S
</items>
</channel>
<image
rdf:about="http://www.example.org/images/lo
go.gif"/>
<image
rdf:about="http://www.example.org/images/lo
go.gif”>
<title>Example</title>
<url>http://www.example.org/images/logo.gif
</url>
<link>http://www.example.org</link>
</image>
<item
rdf:about="http://www.example.org/status/”>
<title>New Status Updates</title>
<link>http://www.example.org/status/</link>
<description>News about the Example
project</description>
</item>
</rdf:RDF>
Prof. Filippo Lanubile
RSS 2.0
<rss version="2.0">
<channel>
<title>Example Channel</title>
<link>http://example.com/</link>
<description>an example
feed</description>
<language>en</language>
<textInput>
<title>Search this site:</title>
<description>Find:</description>
<name>q</name>
<link>http://example.com/search</link>
</textInput>
<skipHours>
<hour>24</hour>
</skipHours>
<item>
<title>1 < 2</title>
<link>http://example.com/1_less_than_
li k htt //
l
/1 l
th
2.html</link>
<description>1 < 2, 3 < 4.
In HTML, <b> starts a bold phrase
and you start a link with <a href=
</description>
</item>
</channel>
/
</rss>
Prof. Filippo Lanubile
5
Atom 1.0
<feed
<entry>
xmlns="http://www.w3.org/2005/Atom"> <title>I robots Atom usano Amok</title>
<link
href="http://example.org/2003/12/13/ato
<title>Feed di esempio</title>
m03"/>
<subtitle>Testo del sotto-titolo
<id>urn:uuid:1225c695-cfb8-4ebb-aaaaqui</subtitle>
80da344efa6a</id>
<link href="http://example.org/"/>
<updated>2003-12<updated>2003-1213T18:30:02Z</updated>
13T18:30:02Z</updated>
<summary>Testo del
<author>
sommario.</summary>
<name>jonny doe</name>
</entry>
<email>[email protected]</email>
</author>
<id>urn:uuid:60a76c80-d399-11d9-b93C- </feed>
0003939e0af6</id>
Prof. Filippo Lanubile
Pubblicare un feed e
renderlo accessibile da una
pagina web
<a href=
href="http://www
http://www.uniba.it/rss.xml
uniba it/rss xml">
>
<img src="rss.gif">
</a>
Prof. Filippo Lanubile
6
Sintassi RSS 2.0
• http://www.rssboard.org/rss-2-0
Prof. Filippo Lanubile
7