Ephigenia / ikea-availability-checker

Command-Line-Script & Library for checking the availability of specific IKEA products in specific stores and/or countries.
MIT License
239 stars 39 forks source link

get stores from meta files #156

Open Ephigenia opened 1 year ago

Ephigenia commented 1 year ago

A list of all stores in a country can be obtained from a URL in the format:

https://www.ikea.com/<cc>/<lc>/meta-data/navigation/stores-detailed.json

Examples for Finland, Germany and austria:

As a first step there should be a script that updates the list of stores using this API for all supported countries.

Teko012 commented 1 year ago

You could parse the available options from the localizedSites from here: https://www.ikea.com/global/en/shared-data/regions.js Most of it supports this, the rest (the list is fairly small, the not ikea.com ones) could be some kind of manual check/maybe a CI check where it calls the API and reports back if it finds a store or country not in the list maybe. That way we could extend it further easily if the API supports it (right now it just dies with a nodeJS error).

Teko012 commented 1 year ago

Also, sometimes the meta files are available both in english and in local language.

Ephigenia commented 1 year ago

Thanks for this additional helpful note about the countries! I also added a project task for this one: https://github.com/Ephigenia/ikea-availability-checker/issues/157

Teko012 commented 1 year ago

One side note I noticed about both: Spain is a special case, the have both kind of sites, so the ikea.com one doesn't include the island ones from islas.ikea.es (I haven't checked if it shows up in the API, but it's not in the meta files)

Teko012 commented 1 year ago

I think if this gets implemented, it should also scrape the API with some generic product (such as the batteries) to get the stores in countries that don't have meta files. I think that should cover all the possibilities.

Teko012 commented 1 year ago

I ran into a missing store. @Ephigenia Do you have any idea for this and #157 when it could be implemented?

Ephigenia commented 1 year ago

I ran into a missing store. @Ephigenia Do you have any idea for this and #157 when it could be implemented?

I don’t have plans for this as I’m working totally occassionally on it. Maybe in 1-2 Months when I got some free time from work.

Teko012 commented 2 weeks ago

@Ephigenia I noticed that the file is now very outdated, some countries are missing close to half the stores. Do you have time to update it maybe? :)