banner
AgedCoffee

AgedCoffee

Create Your Reading Habits with RSS

What is RSS & What are the Benefits#

Really Simple Syndication (RSS) is a standard for simple information aggregation (also known as content aggregation) based on XML, widely used on the Internet for content packaging and delivery. RSS (Really Simple Syndication) is a format for describing and synchronizing website content, and is the most widely used XML application. RSS establishes a technical platform for rapid dissemination of information, making everyone a potential information provider.

  • Essentially an XML file
  • XML contains some summary information about the current website
  • Can be subscribed to and received
  • Not constrained by specific platforms
  • Different information sources can be aggregated using RSS readers
  • No advertisements

Fluent-Reader for Desktop

fluent-reader

Ego-Reader for Mobile

ego-reader

How to Find RSS Feeds#

RSSHub#

RSSHub is an open-source, easy-to-use, and extensible RSS generator that can generate RSS feeds for all kinds of strange content. RSSHub is rapidly developing with the help of the open-source community and currently supports thousands of items from hundreds of websites.

XiTNAl

Assisting in Finding RSS Feeds on Websites#

Google Extension#

RSSHub Radar

ID50BU

Android App#

RSSAid

iOS App#

RSSBud

Checking if Your Favorite Blogs Have RSS Feeds#

7Qk29t

Recommended High-Quality Frontend Blogs

Adding RSS Feeds & Using RSS Readers#

Fluent-Reader
wBUg6e

sHQMCh

Ego-Reader
GvAWAS

fpXTH1

Deploying Your Own RSShub#

The official website provides many deployment methods. It is recommended to use the fork code repository to deploy your own service on the free cloud platform provided by Vercel.

vercel

YFynGM

Adding RSS Feeds to Your Own Blog#

// Information needed to generate RSS feed items
const generateRssItem = (post) => `
  <item>
    <guid>${siteMetadata.siteUrl}/blog/${post.slug}</guid>
    <title>${escape(post.title)}</title>
    <link>${siteMetadata.siteUrl}/blog/${post.slug}</link>
    ${post.summary && `<description>${escape(post.summary)}</description>`}
    <pubDate>${new Date(post.date).toUTCString()}</pubDate>
    <author>${siteMetadata.email} (${siteMetadata.author})</author>
    ${post.tags && post.tags.map((t) => `<category>${t}</category>`).join('')}
  </item>
`

const generateRss = (posts, page = 'feed.xml') => `
  <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
      <title>${escape(siteMetadata.title)}</title>
      <link>${siteMetadata.siteUrl}/blog</link>
      <description>${escape(siteMetadata.description)}</description>
      <language>${siteMetadata.language}</language>
      <managingEditor>${siteMetadata.email} (${siteMetadata.author})</managingEditor>
      <webMaster>${siteMetadata.email} (${siteMetadata.author})</webMaster>
      <lastBuildDate>${new Date(posts[0].date).toUTCString()}</lastBuildDate>
      <atom:link href="${siteMetadata.siteUrl}/${page}" rel="self" type="application/rss+xml"/>
      ${posts.map(generateRssItem).join('')}
    </channel>
  </rss>
`

// For example, in next.js, generate the feed.xml RSS feed file when generating the page
export async function getStaticProps({ params }) {
  const allPosts = await getAllFilesFrontMatter('blog')
  const postIndex = allPosts.findIndex((post) => formatSlug(post.slug) === params.slug.join('/'))
  const prev = allPosts[postIndex + 1] || null
  const next = allPosts[postIndex - 1] || null
  const post = await getFileBySlug('blog', params.slug.join('/'))
  const authorList = post.frontMatter.authors || ['default']
  const authorPromise = authorList.map(async (author) => {
    const authorResults = await getFileBySlug('authors', [author])
    return authorResults.frontMatter
  })
  const authorDetails = await Promise.all(authorPromise)

  // rss
  const rss = generateRss(allPosts)
  fs.writeFileSync('./public/feed.xml', rss)

  return { props: { post, authorDetails, prev, next } }
}
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.