rss-bridge icon indicating copy to clipboard operation
rss-bridge copied to clipboard

Dynamically loading second-level Marktplaats categories

Open Pizzabroodje opened this issue 1 year ago • 6 comments

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

Pizzabroodje avatar Oct 18 '23 21:10 Pizzabroodje

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.

dvikan avatar Oct 19 '23 14:10 dvikan

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)

Pizzabroodje avatar Oct 19 '23 17:10 Pizzabroodje

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.

Park0 avatar Oct 20 '23 10:10 Park0

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

dvikan avatar Nov 10 '23 11:11 dvikan

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.

Park0 avatar Nov 10 '23 18:11 Park0

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.

Pizzabroodje avatar Nov 13 '23 02:11 Pizzabroodje