rbren / rss-parser

A lightweight RSS parser, for Node and the browser
MIT License
1.38k stars 209 forks source link

How can i access `rdf:about` attribute of item? #202

Closed yuiseki closed 2 years ago

yuiseki commented 3 years ago

Some RSS has different value between rdf:about attribute of item and link element.

Example: https://b.hatena.ne.jp/yuiseki/bookmark.rss?date=20210505

<item rdf:about="https://b.hatena.ne.jp/yuiseki/20210505#bookmark-4677240025346791298">
  <title>GitHub - rbren/rss-parser: A lightweight RSS parser, for Node and the browser</title>
  <link>https://github.com/rbren/rss-parser</link>
  <description>Best RSS Parser ever.</description>
  <dc:creator>yuiseki</dc:creator>
  <dc:date>2021-05-05T04:34:58Z</dc:date>
  <dc:subject>github</dc:subject>
  <dc:subject>rss</dc:subject>
  <dc:subject>feed</dc:subject>
  <dc:subject>javascript</dc:subject>
  <taxo:topics>
    ** snip **
  </taxo:topics>
  <content:encoded>** snip **</content:encoded>
  <hatena:bookmarkcount>3</hatena:bookmarkcount>

This RSS has item attribute rdf:about="https://b.hatena.ne.jp/yuiseki/20210505#bookmark-4677240025346791298" and child element <link>https://github.com/rbren/rss-parser</link>

So I need to get rdf:about attribute of item. It is possible on current version rss-parser?

NOTE: I have searched issues of this GitHub repository and found old issue about accessing item attribute. https://github.com/rbren/rss-parser/pull/165

rbren commented 3 years ago

Thanks for linking #165 - would be happy to accept a PR that adds a customAttributes option as mentioned there