尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

RSS and Atom

RSS and Atom
📅 发布时间:2026/6/21 23:01:24
RSS and Atom
What is RSS?
 
ChatGPT said:

RSS (Really Simple Syndication) is a standard web format used to publish frequently updated content, such as news articles, blog posts, podcasts, and announcements.

An RSS feed is essentially a machine-readable list of updates, written in XML, that apps and websites can subscribe to.


✅ What RSS Is Used For

RSS allows users (or applications) to:

  • Subscribe to websites

  • Receive automatic updates whenever new content is published

  • Aggregate many sites into one place (news readers)

For example, instead of visiting 20 news websites, you subscribe to their RSS feeds, and a reader app shows you all updates in one list.


🧠 How RSS Works (Simple)

  1. A website publishes an RSS feed (an XML file) at a URL, e.g.:

    https://example.com/feed.xml
  2. Your RSS reader app checks this file regularly.

  3. When the website updates it (new article → new <item>), your reader shows a notification.


📄 RSS Feed Example (Very Simple XML)

<rss version="2.0"><channel><title>Python News</title><link>https://python.org/</link><description>Latest Python updates</description><item><title>Python 3.13 Released</title><link>https://python.org/downloads/release/3.13/</link><pubDate>Mon, 20 Oct 2025 12:00:00 GMT</pubDate></item></channel>
</rss>

An RSS reader would show:

  • Python 3.13 Released

And clicking it takes you to the link.


⭐ Why RSS Is Useful

  • You don’t need to check websites manually.

  • You get updates instantly.

  • No algorithms decide what you see — you control your feed.

  • Many news apps, podcast apps, and blogs rely on RSS.


📥 Examples of RSS Readers

  • Feedly

  • Inoreader

  • NetNewsWire

  • Thunderbird

  • Reeder (iOS / macOS)


🔌 Why Programmers Use RSS

RSS feeds are easy to process with code.

For example, Python can parse an RSS feed:

import feedparser
feed = feedparser.parse("https://example.com/rss")
for item in feed.entries:print(item.title)

If you want, I can also explain:

  • The difference between RSS and Atom feeds

  • How to parse RSS with Python

  • How to create your own RSS feed

Would you like that?

 
You said:
Yes, I would.
 
ChatGPT said:

Great — here’s a clear explanation of RSS vs Atom, plus how to parse RSS in Python, and how to create your own RSS feed.


🆚 1. RSS vs Atom: What’s the Difference?

RSS and Atom are both XML formats for publishing web feeds, but they have some differences.

✔ RSS (Really Simple Syndication)

  • Older (1999)

  • Simpler format

  • More widespread historically

  • Version widely used: RSS 2.0

  • Uses <item> for entries

✔ Atom (IETF Standard, 2005)

  • Newer, more standardized

  • More flexible and consistent

  • Uses <entry> instead of <item>

  • Contains built-in elements for:

    • Author

    • ID

    • Updated time

    • Links with relation types

Quick Comparison

FeatureRSSAtom
Standard? No single standard Yes (IETF RFC 4287)
Flexibility Less More
Common? Very common Common
Date format Often inconsistent ISO 8601 standardized
Entry label <item> <entry>

Both formats are still used today.

For most purposes, RSS is enough and easier.


🧪 2. How to Parse RSS Feeds in Python

The easiest library is feedparser.

Install:

pip install feedparser

Example: Read an RSS feed

import feedparserurl = "https://hnrss.org/frontpage"  # Hacker News RSS
feed = feedparser.parse(url)print("Feed title:", feed.feed.title)for entry in feed.entries[:5]:print(entry.title)print(entry.link)print("---")

What you get:

Feed title: Hacker News: Front Page
Activeloop (YC S18) Is Hiring MTS(Back End)and AI Search Engineer
https://careers.activeloop.ai/
---
Our investigation into the suspicious pressure on Archive.today
https://adguard-dns.io/en/blog/archive-today-adguard-dns-block-demand.html
---
One Handed Keyboard
https://github.com/htx-studio/One-Handed-Keyboard
---
NATO Ended Russia's Estonian Air Incursions
https://themilitaryanalyst.com/2025/11/13/the-real-story-how-nato-ended-russias-estonian-air-incursions/
---
Spec-Driven Development: The Waterfall Strikes Back
https://marmelab.com/blog/2025/11/12/spec-driven-development-waterfall-strikes-back.html
---

Feedparser works for RSS and Atom automatically.


🧱 3. How to Create Your Own RSS Feed (Simple Example)

A minimal RSS 2.0 feed:

<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><title>Frank's Blog</title><link>https://example.com</link><description>Updates from Frank</description><item><title>Hello World</title><link>https://example.com/hello</link><guid>1</guid><pubDate>Sun, 16 Nov 2025 12:00:00 GMT</pubDate><description>This is my first article.</description></item></channel>
</rss>

Save it as feed.xml and serve it via your website.


🧱 4. Create an RSS Feed Using Python

Here’s a simple script to generate RSS XML:

 
from datetime import datetime
import xml.etree.ElementTree as ETrss = ET.Element("rss", version="2.0")
channel = ET.SubElement(rss, "channel")ET.SubElement(channel, "title").text = "Frank's Blog"
ET.SubElement(channel, "link").text = "https://example.com"
ET.SubElement(channel, "description").text = "Updates from Frank"item = ET.SubElement(channel, "item")
ET.SubElement(item, "title").text = "Hello World"
ET.SubElement(item, "link").text = "https://example.com/hello"
ET.SubElement(item, "guid").text = "1"pub_date = datetime.utcnow().strftime("%a, %d %b %Y %H:%M:%S GMT")
ET.SubElement(item, "pubDate").text = pub_date
ET.SubElement(item, "description").text = "This is my first article."tree = ET.ElementTree(rss)
tree.write("feed.xml", encoding="utf-8", xml_declaration=True)

Output: a valid RSS feed file feed.xml.


🧩 Want More?

I can also show you:

  • How to create Atom feeds

 


✅ How to Create an Atom Feed

Atom is a more modern, standardized format than RSS.
Here is a minimal valid Atom 1.0 feed.


📄 Example Atom Feed (XML)

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Frank's Atom Feed</title><link href="https://example.com/"/><updated>2025-11-16T12:00:00Z</updated><id>https://example.com/feed.atom</id><entry><title>Hello World</title><link href="https://example.com/hello"/><id>tag:example.com,2025-11-16:/hello</id><updated>2025-11-16T12:00:00Z</updated><summary>This is my first Atom entry.</summary></entry></feed>

Atom uses:

  • <feed> instead of <rss>

  • <entry> instead of <item>

  • <updated> in ISO 8601 format

  • <id> a globally unique identifier


🧱 Generate an Atom Feed with Python

from datetime import datetime
import xml.etree.ElementTree as ETATOM_NS = "http://www.w3.org/2005/Atom"
ET.register_namespace("", ATOM_NS)feed = ET.Element("{%s}feed" % ATOM_NS)ET.SubElement(feed, "{%s}title" % ATOM_NS).text = "Frank's Atom Feed"
ET.SubElement(feed, "{%s}link" % ATOM_NS, href="https://example.com/")
ET.SubElement(feed, "{%s}updated" % ATOM_NS).text = datetime.utcnow().isoformat() + "Z"
ET.SubElement(feed, "{%s}id" % ATOM_NS).text = "https://example.com/feed.atom"entry = ET.SubElement(feed, "{%s}entry" % ATOM_NS)
ET.SubElement(entry, "{%s}title" % ATOM_NS).text = "Hello World"
ET.SubElement(entry, "{%s}link" % ATOM_NS, href="https://example.com/hello")
ET.SubElement(entry, "{%s}id" % ATOM_NS).text = "tag:example.com,2025-11-16:/hello"
ET.SubElement(entry, "{%s}updated" % ATOM_NS).text = datetime.utcnow().isoformat() + "Z"
ET.SubElement(entry, "{%s}summary" % ATOM_NS).text = "This is my first Atom entry."tree = ET.ElementTree(feed)
tree.write("feed.atom", encoding="utf-8", xml_declaration=True)

This creates a file feed.atom.

相关新闻

  • 通用会话控制方案
  • pythontip 从字典中删除一组键
  • Softmax 函数全面而详细的解读,原理、图像、应用 - 详解

最新新闻

  • 2026佛山防水补漏上门施工哪家强?正规商家资质+报价+口碑+售后四维实测对比 - 防水资讯
  • 2026年南京全站仪服务商:资质与服务能力客观对比 - 起跑123
  • STM32单片机心率血氧血压温度检测082X-3(设计源文件+万字报告+讲解)(支持资料、图片参考_相关定制)_文章底部可以扫码
  • HC908 MCU时钟系统与PLL配置实战:从原理到代码实现
  • 2026东莞防水补漏上门施工哪家强?正规商家资质+报价+口碑+售后四维实测对比 - 防水资讯
  • FanControl深度解析:Windows平台精准风扇控制架构与技术实现

日新闻

  • Visual C++运行库修复终极指南:5分钟快速解决Windows软件启动错误
  • 手把手教你构建统计局地区经济数据爬虫:从环境搭建到数据持久化全指南
  • 2026多Agent深度解析:用AI团队替代单一模型,四种架构实战落地

周新闻

  • Visual C++运行库修复终极指南:5分钟快速解决Windows软件启动错误
  • 手把手教你构建统计局地区经济数据爬虫:从环境搭建到数据持久化全指南
  • 2026多Agent深度解析:用AI团队替代单一模型,四种架构实战落地

月新闻

  • 【总结】入门篇:50句话让你记住架构核心概念
  • WeChatMsg技术方案解析:实现Mac微信数据自主管理的完整解决方案
  • WeChatMsg:革新性微信数据备份方案,打造你的专属数字记忆库

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号