RSS-Bridge / rss-bridge

The RSS feed for websites missing it
https://rss-bridge.org/bridge01/
The Unlicense
7.21k stars 1.03k forks source link

Dynamically loading second-level Marktplaats categories #3773

Open Pizzabroodje opened 11 months ago

Pizzabroodje commented 11 months ago

Hi!

I want to follow up on this issue: https://github.com/RSS-Bridge/rss-bridge/issues/3613 Which was partly resolved in this pull request: https://github.com/RSS-Bridge/rss-bridge/pull/3761

There's two levels of categories: L1 and L2. There's just a few L1 categories, but every one of those has a ton of L2 categories. Hardcoding the L1 categories is fine but there's too many L2 categories to hardcode those too.

Perhaps these can be dynamically loaded though?

L2 categories are returned with a GET request to https://www.marktplaats.nl/lrp/api/search?l1CategoryId=1744 and can be searched using https://www.marktplaats.nl/lrp/api/search?l1CategoryId=1744&l2CategoryId=1745

dvikan commented 11 months ago

dynamically loaded is possible but dont like it.

can we please just have two textboxes for the category numbers? or herhaps for the subcategory?

also i might be overreacting but the frontpage have very much html and loads badly for slower devices.

also annoying to scroll through a gigantic <select>.

the html standards do have an autocomplete option for `<input type=text'> but that would require rssbridge core modification.

Pizzabroodje commented 11 months ago

dynamically loaded is possible but dont like it.

can we please just have two textboxes for the category numbers? or herhaps for the subcategory?

also i might be overreacting but the frontpage have very much html and loads badly for slower devices.

also annoying to scroll through a gigantic <select>.

the html standards do have an autocomplete option for `<input type=text'> but that would require rssbridge core modification.

Way less annoying to scroll through a gigantic <select> than having to check the ID of a certain category every time. The categories are in alphabetical order so not too hard to find one.

Why do you not like dynamically loading them? Then you'd have two <select>s, one with the main categories, and when you select one there it'll load the sub categories into the second <select>. I see this as being the best possible solution. (And Marktplaats themselves do it in a similar way too: first you select a main category, then you search, and then you can choose a subcategory of the chosen main category with that same select box)

Park0 commented 11 months ago

Something like https://select2.org/ or https://dselect.vercel.app/ would be very nice to have as a option. But it would require some JS libraries. It should not slow the loading of the page that much. Maybe the first time when the libraries are loaded. But after that only when u use it.

In case of Marktplaats it could even integrate both levels. So it only requires one select with a search.

dvikan commented 10 months ago

how is the current solution working out without the convenience of a second-level cat?

Park0 commented 10 months ago

For me it does not matter that much but for users that are less aware of the technical stuff it would be hard i guess.

Pizzabroodje commented 10 months ago

how is the current solution working out without the convenience of a second-level cat?

I've made a version of my own using hard coded categories. Haven't used marktplaats recently though, only to sell stuff. But when I will have to look for something again I will use that.

Even if you have the knowledge of how to get the category id's it's very nice to be able to get it directly if you search in different categories each time, so you don't have to get the id manually each time.