Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RSS Results Structure Changes Depending on Normalization #74

Closed
JulianWebb opened this issue Dec 27, 2022 · 5 comments
Closed

RSS Results Structure Changes Depending on Normalization #74

JulianWebb opened this issue Dec 27, 2022 · 5 comments

Comments

@JulianWebb
Copy link

Hello!

I am glad to have found your module, it looks like it will make handling feeds easy.


The structure of the results from fetching an RSS feed depends on if the normalization option is set.

If it is false then the object containing the feed items is called item and if it is true then it is called entries.

I do not know if this is intended behaviour, however the documentation doesn't mention it either way.

@ndaidong
Copy link
Collaborator

@JulianWebb thank you. When you don't use normalization, this lib will keep the structure as it is. That's is expected behaviour.

In real world, it's more complicate than you said, here is what I known:

  • RSS uses tag name item, ATOM uses tag name entry
  • item and entry can be an array or single object (when there is only one item)
  • JSONFeed uses items. Despite the fact that it's plural, it can be single object too!

So I recommend to enable normalization option if you need something more consistent.

@JulianWebb
Copy link
Author

JulianWebb commented Dec 27, 2022

If I enable normalization though, I lose data from the item's fields because it gets stripped.

I understand that the names are different, I just think it makes sense to expand the documentation around the normalization option to inform people of this.

@ndaidong
Copy link
Collaborator

@JulianWebb I agree that it is better to described more clear. The documentation is quite sketchy, not fully telling the capabilities of this library 🔔

Note that 2 methods getExtraFeedFields and getExtraEntryFields can help you get any data from feeds when you need, similar to #66

@JulianWebb
Copy link
Author

Do those methods stop the normalization from stripping HTML and CDATA?

@ndaidong
Copy link
Collaborator

ndaidong commented Dec 29, 2022

@JulianWebb no, they don't stop normalizing, but allow to choose which content you want to pick from the original data and how you customize these pieces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants