Atom Links

From RadioConnected
Jump to: navigation, search

Atom defines a <link> element with the following attributes:

href
A de-referenceable URI which is the target of the link.
rel
The link relation. This defines the meaning of the link. E.g. 'related' points to related content. 'alternate' always points to a human-readable version of the content. New link relations can be defined using URIs. See http://www.iana.org/assignments/link-relations/
type
Indicates the MIME type of the content.
title
An optional human-readable title. Can be used to disambiguate links with the same rel type.
length
An indication of the content length.

Totallyradio uses links for the following purposes:

rel=enclosure
See below
rel=related
Related feeds, e.g. the episodes feed for a show. Arguably this could use the "down" relation instead.
rel=logo or icon
See Images

Enclosures

Enclosures are our most important use of links, as this is the way we embed audio into our feeds. A typical audio link looks like this:

  <link href="http://example.com/1882256168477.mp3" type="audio/mpeg" 
        rel="enclosure" title="The Daily Show from totallyradio.com"/>

Note:

  • The type attribute is used to determine the media type of the file. If we wanted to add AAC, we would add another link with type="audio/aac" and let clients decide which one to use.
  • The title attribute means that if a link carries some context if it is removed from its entry

We could also use the length attribute although we don't at present.