Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token, cannot get reviews #208

Open
LrDaniel opened this issue Oct 31, 2024 · 3 comments
Open

Unexpected token, cannot get reviews #208

LrDaniel opened this issue Oct 31, 2024 · 3 comments

Comments

@LrDaniel
Copy link

  • Operating System: macOS
  • Node version: 18.20
  • app-play-scraper version: 0.18.0

Getting an "Unexpected token < in JSON at position 0" when trying to get reviews

checking the response from the itunes url
const url = https://itunes.apple.com/${opts.country}/rss/customerreviews/page=${opts.page}/id=${id}/sortby=${opts.sort}/json;
im getting this HTML :

<body onload="return its.detect.openItunes('https://itunes.apple.com/us/store?ign-mscache=1');">

 <!-- InternetExplorer ActiveX Component (must have non-zero width/height!) -->
 <object classID="CLSID:D719897A-B07A-4C0C-AEA9-9B663A28DFCB" width="1" height="1" id="iTunesDetectorIE" ></object>
  <div id="loadingbox-wrapper">
  <div class="loadingbox">
     <p class="title">Connecting to the iTunes Store.<span id="loading-dots">..</span></p>

      <div class="clear"></div>

        <!-- User Override Panel.
           By default, we show this panel so users with javascript disabled can click through
           to the store.  If javascript is enabled, the code snippet at the bottom of the div
           will hide the panel. AFTER that, if the check for iTunes yields indeterminate results,
           this panel will be unhidden by the script in itmsCheck.js.
           Don't change the id of this div; it's used by itmsCheck.js
         -->
        <div id="itunes-client-required" style="display:block;">
         <center><br>
          <p style="color: red;">
           We are unable to find iTunes on your computer.
          </p><br>
           <a onclick="its.detect.userOverrideSetItunesInstalled(); its.detect.openItunes(); return true;" href="#">
            <input type="submit" value="I have iTunes" />
           </a>
          <a href="http://www.apple.com/itunes/download/?itunesInstalled=unknown"><input type="submit" value="Download iTunes" /></a>
         </center>
         <script type="text/javascript">
           document.getElementById('itunes-client-required').style.display='none';
         </script>
        </div>
        <!-- End user override panel -->

     <p class="footer">If you don't have iTunes, <a href="http://www.apple.com/itunes/download/">download it for free</a>. If you have iTunes and it doesn't open automatically, try opening it from your dock or Windows task bar.</p>
  </div></div>
 </body>
@LrDaniel
Copy link
Author

  • Operating System: macOS 15
  • Node version: 18.20
  • app-play-scraper version: 0.18.0

Getting an "Unexpected token < in JSON at position 0" when trying to get reviews

checking the response from the itunes url const url = https://itunes.apple.com/${opts.country}/rss/customerreviews/page=${opts.page}/id=${id}/sortby=${opts.sort}/json; im getting this HTML :

<body onload="return its.detect.openItunes('https://itunes.apple.com/us/store?ign-mscache=1');">

 <!-- InternetExplorer ActiveX Component (must have non-zero width/height!) -->
 <object classID="CLSID:D719897A-B07A-4C0C-AEA9-9B663A28DFCB" width="1" height="1" id="iTunesDetectorIE" ></object>
  <div id="loadingbox-wrapper">
  <div class="loadingbox">
     <p class="title">Connecting to the iTunes Store.<span id="loading-dots">..</span></p>

      <div class="clear"></div>

        <!-- User Override Panel.
           By default, we show this panel so users with javascript disabled can click through
           to the store.  If javascript is enabled, the code snippet at the bottom of the div
           will hide the panel. AFTER that, if the check for iTunes yields indeterminate results,
           this panel will be unhidden by the script in itmsCheck.js.
           Don't change the id of this div; it's used by itmsCheck.js
         -->
        <div id="itunes-client-required" style="display:block;">
         <center><br>
          <p style="color: red;">
           We are unable to find iTunes on your computer.
          </p><br>
           <a onclick="its.detect.userOverrideSetItunesInstalled(); its.detect.openItunes(); return true;" href="#">
            <input type="submit" value="I have iTunes" />
           </a>
          <a href="http://www.apple.com/itunes/download/?itunesInstalled=unknown"><input type="submit" value="Download iTunes" /></a>
         </center>
         <script type="text/javascript">
           document.getElementById('itunes-client-required').style.display='none';
         </script>
        </div>
        <!-- End user override panel -->

     <p class="footer">If you don't have iTunes, <a href="http://www.apple.com/itunes/download/">download it for free</a>. If you have iTunes and it doesn't open automatically, try opening it from your dock or Windows task bar.</p>
  </div></div>
 </body>

@brunnoandradegok
Copy link

I have the same problem.

@ngo275
Copy link

ngo275 commented Dec 2, 2024

https://www.npmjs.com/package/app-store-client

I have created a TypeScript version. This one works well. Please check it out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants