Giter Site home page Giter Site logo

Comments (6)

danieldram avatar danieldram commented on July 18, 2024 1

I'll help with this! I'll take a look at implementing over the weekend. Least I can do, this is a great package @facundoolano thank you for taking the time to produce it :)

from app-store-scraper.

zapolnoch avatar zapolnoch commented on July 18, 2024 1

Unfortunately, I found that the scraper does not really support other languages when searching. For example:

store.search({
  term: 'привет'
}).then(res => {
  console.log(res.length) // return 0
})

But if we call encodeURIComponent:

store.search({
  term: encodeURIComponent('привет')
}).then(res => {
  console.log(res.length) // return 11
})

from app-store-scraper.

zapolnoch avatar zapolnoch commented on July 18, 2024 1

I think that you should always use encodeURIComponent for strings that will be passed as part of the URI. This is necessary to encode the string as a valid URI component.
I did console.log(response.headers['x-apple-orig-url']) in this place and received the following results:

https://itunes.apple.com/search?media=software&entity=software&term=%D0%BF%D1%80%D0%B8%D0%B2%D0%B5%D1%82&limit=50&country=RU
this is the correct URL. If you do not use encodeURIComponent, you get such a bad result:
https://itunes.apple.com/search?media=software&entity=software&term=?@825B&limit=50&country=RU

from app-store-scraper.

facundoolano avatar facundoolano commented on July 18, 2024

All of underlying APIs support other languages, I just never got around adding the options to support them. I'll add it next time I sit down to update this library (PRs are welcome).

from app-store-scraper.

facundoolano avatar facundoolano commented on July 18, 2024

How does encodeURIComponent affect the search? Would it work to always encode the term?

from app-store-scraper.

facundoolano avatar facundoolano commented on July 18, 2024

This has been open for a while, and it's rather generic, so I'm closing it now. Feel free to reopen more specific issues (e.g. method X doesn't support other languages)

from app-store-scraper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.