RIAEvangelist / node-dominos-pizza-api

This is a node.js wrapper for the dominos pizza apis
MIT License
547 stars 132 forks source link

The NearbyStores function doesnt work #122

Closed SebastianMostert closed 1 year ago

SebastianMostert commented 2 years ago
import {NearbyStores} from '../index.js';

const nearbyStores=await new NearbyStores('110 S Fairfax Ave, 90036');

console.dir(nearbyStores,{depth:5});

console.log('\n\nFirst store in the list');
console.dir(nearbyStores.stores[0],{depth:0});

C:\Users\mosse\Downloads\node-dominos-pizza-api-master\node-dominos-pizza-api-master\node_modules\node-fetch\lib\index.js:1461 reject(new FetchError(request to ${request.url} failed, reason: ${err.message}, 'system', err)); ^ FetchError: request to https://order.dominos.com/power/store-locator?s=110%20S%20Fairfax%20Ave&c=%20%2090036&type=Delivery failed, reason: connect ETIMEDOUT 209.211.200.20:443 at ClientRequest. (C:\Users\mosse\Downloads\node-dominos-pizza-api-master\node-dominos-pizza-api-master\node_modules\node-fetch\lib\index.js:1461:11) at ClientRequest.emit (node:events:394:28) at TLSSocket.socketErrorListener (node:_http_client:447:9) at TLSSocket.emit (node:events:394:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { type: 'system', errno: 'ETIMEDOUT', code: 'ETIMEDOUT' }

RIAEvangelist commented 2 years ago

Looks like you timed out, were you making a lot of requests?

odog2454 commented 2 years ago

I seem to be getting a similar error image

odog2454 commented 2 years ago

From running this image

odog2454 commented 2 years ago

And like I have tried a large number of different types of addresses

odog2454 commented 2 years ago

After further investigation I found that the request is getting denied and returning HTML which causes the error. Do you know why this might be happening? image

odog2454 commented 2 years ago

I think this is occuring because I'm in New Zealand. I have seen the bit in the docs on adding international urls but do you know how I would go about finding all the urls needed for New Zealand?

RIAEvangelist commented 2 years ago

Hey Oscar. Just caught up on your logs here. Thanks for all the info! It really helps me understand what you are experiencing and how I can help!

My first suggestion would be to look at the internationalization examples as you mentioned you have and then open up the console on the NZ Domino's site. Watch the requests being made and inspect the urls. It's most likely going to be a simple change in the pattern. Once you find what needs to change, you can make a new file for NZ and we can get it updated!

Good luck! And let me know if you need to do a Google meet or something.

Best,

Brandon

On Wed, May 4, 2022, 7:09 PM Oscar Sykes @.***> wrote:

I think this is occuring because I'm in New Zealand. I have seen the bit in the docs on adding international urls but do you know how I would go about finding all the urls needed for New Zealand?

— Reply to this email directly, view it on GitHub https://github.com/RIAEvangelist/node-dominos-pizza-api/issues/122#issuecomment-1118097933, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC2DEIYSJXZADLBDZN4VPTVIMUUBANCNFSM5LMYZNKQ . You are receiving this because you commented.Message ID: @.***>

odog2454 commented 2 years ago

Thanks for the detailed response Brandon!