Coder Social home page Coder Social logo

chipsandguac's Introduction

ChipsAndGuac

Node.js API for programmatically ordering from the Chipotle website. This module can be used for locating nearby Chipotle restaurants, looking up favorite and recent orders, checking available pickup times, and of course, placing orders.

NPM

Usage

var ChipsAndGuac = require('chipsandguac')

// instantiate a new ChipsAndGuac object, passing in required configuration and credentials.
var cag = new ChipsAndGuac({
  email:'EMAIL_GOES_HERE', 
  password:'PASSWORD_GOES_HERE', 
  locationId: 'LOCATION_ID', 
  phoneNumber:'555.555.5555' // must match user profile
});

Find nearby locations (useful for getting location ID above)

cag.getNearbyLocations("80123").then(function(locations) {
  console.log(JSON.stringify(locations));
});

// output (Array)
[ 
  { id: 1430, name: '8100 W. Crestline Ave' },
  { id: 644, name: '3170 S. Wadsworth' },
  { id: 970, name: '5699 S. Broadway' },
  { id: 71, name: '12512 W. Ken Caryl Ave.' },
  { id: 390, name: '333 W. Hampden Ave.' } 
]

Look up recent orders (useful for getting previous order ID)

cag.getOrders().then(function(orders) {
  console.log(orders);
});

// output (Array)
[
  {
    "id": 123456789,
    "name":"Recent Order #1",
    "items":[
      {
        "name":"1 x Chicken Burrito Bowl",
        "details":"Brown Rice, Black Beans, Extra Chicken, Fresh Tomato Salsa, Tomatillo-Red Chili Salsa, Cheese"
      }
    ]
  }
]

Place an order (using a previous order ID)

Note: passing true for the second argument in this call will NOT place an order. This is useful for previewing the order and looking up the next available pickup time. If this parameter is left off, or if false is passed, the order WILL be placed.

cag.submitPreviousOrderWithId(123456789, true).then(function(orderDetails) {
  console.log(orderDetails);
});

// output
{
  pickupTimes: [ '5/14/2015 9:30:00 PM', '5/14/2015 9:45:00 PM' ],
  items:
   [ { name: 'Your Name',
       itemName: 'Chicken Burrito Bowl',
       itemDetails: '...' }],
  location: '8100 W Crestline Ave, Denver, CO 80123' 
}

chipsandguac's People

Contributors

jquatier avatar

Watchers

 avatar

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.