Introduction to Atom

🔥 Explore this trending post from Hacker News 📖

📂 **Category**:

💡 **What You’ll Learn**:

Contents

What is Atom?

Atom is the name of an XML-based Web content and metadata syndication format, and an application-level protocol for publishing and editing Web resources belonging to periodically updated websites.

All Atom feeds must be well-formed XML documents, and are identified with the application/atom+xml media type.

About this document

This document focuses on
The Atom Syndication Format
produced by the
IETF
AtomPub Working Group. In the event that this document differs from the Internet Draft, the Internet Draft is to be considered authoritative.

General considerations:

  • All elements described in this document must be in the http://www.w3.org/2005/Atom namespace.
  • All timestamps in Atom must conform to RFC 3339.
  • Unless otherwise specified, all values must be plain text (i.e., no entity-encoded html).
  • xml:lang may be used to identify the language of any human readable text.
  • xml:base may be used to control how relative URIs are resolved.

Sample feed




  Example Feed
  
  2003-12-13T18:30:02Z
  
    John Doe
  
  urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6

  
    Atom-Powered Robots Run Amok
    
    urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a
    2003-12-13T18:30:02Z
    Some text.
  


Elements of

A Feed consists of some metadata, followed by any number of entries.

Required feed elements

Here’s a list of the required feed elements, each with a brief description, and an example.

Element Description
id Identifies the feed using a universally unique and permanent
URI.
If you have a long-term, renewable lease on your Internet domain name,
then you can feel free to use your website’s address.

http://example.com/
title Contains a human readable title for the feed. Often the same
as the title of the associated website. This value should not be blank.

Example, Inc.
updated Indicates the last time the feed was modified in a
significant way.

2003-12-13T18:30:02Z

Recommended feed elements

Atom makes a number of additional requirements and recommendations for feed elements that you should to be aware of. They are as follows:

Element Description
author Names one author of the feed. A feed may have multiple
author elements. A feed must contain at least one
author element unless all of the entry
elements contain at least one author element. More
info here.


  John Doe
  JohnDoe@example.com
  http://example.com/~johndoe
link Identifies a related Web page. The type of relation is defined by the rel attribute. A feed is limited to one alternate per type and hreflang. A feed should contain a link back to the feed itself. More info here.

Optional feed elements

Here’s a list of optional feed elements.

Element Description
category Specifies a category that the feed belongs to. A feed may have multiple category elements. More info here.

contributor Names one contributor to the feed. An feed may have multiple contributor elements. More info here.


  Jane Doe
generator Identifies the software used to generate the feed, for debugging and other purposes. Both the uri and version attributes are optional.


  Example Toolkit
icon Identifies a small image which provides iconic visual identification for the feed. Icons should be square.

/icon.jpg
logo Identifies a larger image which provides visual identification for the feed. Images should be twice as wide as they are tall.

/logo.jpg
rights Conveys information about rights, e.g. copyrights, held in and over the feed. More info here.

 © 2005 John Doe 
subtitle Contains a human-readable description or subtitle for the feed. More info here.

all your examples are belong to us

Elements of

An example of an entry would be a single post on a weblog.

Required Elements of

Here’s a list of the required feed elements, each with a brief description, and an example.

Element Description
id Identifies the entry using a universally unique and permanent
URI.
Suggestions on how to make a good id can be found
here.
Two entries in a feed can have the same value for id if they represent the
same entry at different points in time.

http://example.com/blog/1234
title Contains a human readable title for the entry.
This value should not be blank.

Atom-Powered Robots Run Amok
updated Indicates the last time the entry was modified in a
significant way. This value need not change after a typo is fixed, only
after a substantial modification. Generally, different entries in a feed
will have different updated timestamps.

2003-12-13T18:30:02-05:00

Recommended elements of

Atom makes a number of additional requirements and recommendations for entry elements that you should to be aware of. They are as follows:

Element Description
author Names one author of the entry. An entry
may have multiple authors. An entry must contain at least one
author element unless there is an author element
in the enclosing feed, or there is an author element
in the enclosed source element.
More info here.


  John Doe
content Contains or links to the complete content of the entry. Content must be provided if there is no alternate link, and should be provided if there is no summary. More info here.

complete story here
link Identifies a related Web page. The type of relation is defined by the rel attribute. An entry is limited to one alternate per type and hreflang. An entry must contain an alternate link if there is no content element. More info here.

summary Conveys a short summary, abstract, or excerpt of the entry. Summary should be provided if there either is no content provided for the entry, or that content is not inline (i.e., contains a src attribute), or if the content is encoded in base64. More info here.

Some text.

Optional elements of

Here’s a list of optional feed elements.

Element Description
category Specifies a category that the entry belongs to. A entry may have multiple category elements. More info here.

contributor Names one contributor to the entry. An entry may have multiple contributor elements. More info here.


  Jane Doe
published Contains the time of the initial creation or first availability of the entry.

2003-12-13T09:17:51-08:00
rights Conveys information about rights, e.g. copyrights, held in and over the entry. More info here.


  © 2005 John Doe
source Contains metadata from the source feed if this
entry is a copy.


  http://example.org/
  Example, Inc.
  2003-12-13T18:30:02Z

Common Constructs

Category

has one required attribute, term, and two optional attributes, scheme and label.

term identifies the category

scheme identifies the categorization scheme via a
URI.

label provides a human-readable label for display

Content

either contains, or links to, the complete content of the entry.

In the most common case, the type attribute is either text, html, xhtml, in which case the content element is defined identically to other text constructs, which are described here.

Otherwise, if the src attribute is present, it represents the URI of where the content can be found. The type attribute, if present, is the media type of the content.

Otherwise, if the type attribute ends in +xml or /xml, then an xml document of this type is contained inline.

Otherwise, if the type attribute starts with text, then an escaped document of this type is contained inline.

Otherwise, a base64 encoded document of the indicated media type is contained inline.

is patterned after html’s link element. It has one required attribute, href, and five optional attributes: rel, type, hreflang, title, and length.

href is the URI of the referenced resource (typically a Web page)

rel contains a single link relationship type. It can be a full URI (see extensibility), or one of the following predefined values (default=alternate):

  • alternate: an alternate representation of the entry or feed, for example a permalink to the html version of the entry, or the front page of the weblog.
  • enclosure: a related resource which is potentially large in size and might require special handling, for example an audio or video recording.
  • related: an document related to the entry or feed.
  • self: the feed itself.
  • via: the source of the information provided in the entry.

type indicates the media type of the resource.

hreflang indicates the language of the referenced resource.

title human readable information about the link, typically for display purposes.

length the length of the resource, in bytes.

Person

and describe a person, corporation, or similar entity. It has one required element, name, and two optional elements: uri, email.

conveys a human-readable name for the person.

contains a home page for the person.

contains an email address for the person.

Text

</code>, <code></p> <summary/></code>, <code><content/></code>, and <code><rights/></code> contain human-readable text, usually in small quantities. The <code>type</code> attribute determines how this information is encoded (default=”text”)</p> <p>If <code>type="text"</code>, then this element contains plain text with no entity escaped html.</p><!-- Ezoic - wp_incontent_7 - incontent_7 --><div id="ezoic-pub-ad-placeholder-135" data-inserter-version="2" data-placement-location="incontent_7"></div><script data-ezoic="1" data-no-optimize="1" data-no-defer="1">ezstandalone.cmd.push(function () { ezstandalone.showAds(135); });</script><!-- End Ezoic - wp_incontent_7 - incontent_7 --> <pre><title type="text">AT&T bought by SBC!

If type="html", then this element contains entity escaped html.


  AT&amp;T bought <b>by SBC</b>!

If type="xhtml", then this element contains inline xhtml, wrapped in a div element.


  <p>
    AT&T bought <b>by SBC</b>!
  </p>

Extending Atom

The atom content element is designed to support the direct inclusion of other XML vocabularies.

Any fully qualified URI may be used a value for the rel attribute of link elements.

Elements from other namespaces may be included pretty much anywhere. This means that most RSS 1.0 and RSS 2.0 modules may be used in Atom.

See Also

⚡ **What’s your take?**
Share your thoughts in the comments below!

#️⃣ **#Introduction #Atom**

🕒 **Posted on**: 1777863450

🌟 **Want more?** Click here for more info! 🌟

By

Leave a Reply

Your email address will not be published. Required fields are marked *