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

item_title with more entries then item_description #69

Closed
tombroekel opened this issue Jan 26, 2023 · 2 comments
Closed

item_title with more entries then item_description #69

tombroekel opened this issue Jan 26, 2023 · 2 comments

Comments

@tombroekel
Copy link

Hi,
an error occurs when applying tidyfeed() to the following feed: "https://feed.ksta.de/feed/rss/index.rss". The reason seems to be that in rss_parse() the creation of the object "entries" as a tibble is done such that item_title and item_description need to have the same number of entries. However, this does not seem to be the case for all feeds. The problem is the transformation via unlist(), which does not preserve the length of the original list object created by map(). A possible solution is to pipe the item_description (or any other) object at this stage into the following function:
replace_null <- function(x){
x <- purrr::map(x, ~ replace(.x, is.null(.x), NA_character_))
purrr::map(x, ~ if(is.list(.x)) replace_null(.x) else .x)
}
But there might be a more efficient way!

@RobertMyles
Copy link
Owner

Thanks Tom, I'll take a look at that asap.

RobertMyles added a commit that referenced this issue Mar 5, 2023
@RobertMyles
Copy link
Owner

I've added that in to the package, Tom, thank you. I'll add you as a contributor.

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