Skip to content

Instantly share code, notes, and snippets.

@avinayak
Last active January 15, 2019 15:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avinayak/d150111ecfdb65a669a4b17a78abeebd to your computer and use it in GitHub Desktop.
Save avinayak/d150111ecfdb65a669a4b17a78abeebd to your computer and use it in GitHub Desktop.
//go to swiggy.com
//log in
//press F12 on home page
//paste the script given below in console and press enter
//all_orders object will be populated with all your swiggy order data
all_orders=[]
recfetch = (oid)=>{
fetch('https://www.swiggy.com/dapi/order/all?order_id='+oid)
.then((resp) => resp.json())
.then((or)=>{
all_orders.push(...or.data.orders)
var loworder = Math.min(...or.data.orders.map(x=>parseInt(x.order_id)));
console.log(loworder);
recfetch(loworder);
})
.catch(()=>{
console.log('completed')
console.log(all_orders)
})
}
recfetch('');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment