pipes-digital / pipes

Repository for Pipes
https://pipes.digital
GNU Affero General Public License v3.0
264 stars 21 forks source link

When only one date is provided to a feed builder, use it for all items #114

Open anewuser opened 2 years ago

anewuser commented 2 years ago

In this example, all items are created from elements on the same static page, so there's just one date input: https://www.pipes.digital/editor/0Oo33JOK . Currently, only the first item gets the extracted date, while the rest gets the current date.

If only a single date is provided to a Build Feed block that generates multiple items, I believe it's safe to assume that all items were posted on the same day and then apply the date to all of them.

103 can use this logic too. If there's just one category input, apply it to all items.

onli commented 2 years ago

Hm. I agree that how the system behaves is not great currently, it is hard to handle when input feeds have different length, like with the shorter date here.

But I fear adding "a single item means all items" could also be confusing. It feels like a good solution though, no? But then when you have two dates for twenty items, wouldn't the current date usage for the 18 items without a date be very surprising?

There is an alternative, but we might need more blocks for it: Duplication of the date. Sadly, the duplicate block is not at all what we need here. But a "clone" block (open for naming suggestions!) that stretches the date feed to have 20 items could make it clear. Even better when combined with a count block, so the amounts of dates can be set to the amount of content items.

What do you think about this alternative?

anewuser commented 2 years ago

But then when you have two dates for twenty items

If you're talking about a static page organized like this:

2022-08-06
* Post 1
* Post 2
2022-08-05
* Post 1
* Post 2
* Post 3
2022-08-04
* Post 1

It makes more sense for Pipes users to extract posts by groups instead of creating separate feed items for each of them.

If you were thinking of an actual RSS feed that only adds dates to some of its items, then that's something that should be fixed by its author, and in my opinion it's a better idea to keep adding the current date to items without dates, so that they'll show up on feed readers.

anewuser commented 2 years ago

It makes more sense for Pipes users to extract posts by groups

Here's my simple grouping solution:

https://anewuser.github.io/temp/ https://www.pipes.digital/feedpreview/oqn3pj9w

This pipe would always get the most recent group of items. All future posts would be nicely organized by date in your feed reader.

However, if you want to split the group and put each post in a separate item, then it'll be necessary for you get the single date you have and add it to all items. :)