Permalink
Please sign in to comment.
Showing
with
556 additions
and 0 deletions.
- +19 −0 LICENSE.txt
- +61 −0 README.md
- +23 −0 config.json
- +427 −0 lib/makemeasandwich.js
- +26 −0 package.json
19
LICENSE.txt
| @@ -0,0 +1,19 @@ | ||
| +The MIT License (MIT) | ||
| +Copyright (c) 2013 Travis Tidwell | ||
| + | ||
| +Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
| +this software and associated documentation files (the "Software"), to deal in the | ||
| +Software without restriction, including without limitation the rights to use, | ||
| +copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the | ||
| +Software, and to permit persons to whom the Software is furnished to do so, | ||
| +subject to the following conditions: | ||
| + | ||
| +The above copyright notice and this permission notice shall be included in all | ||
| +copies or substantial portions of the Software. | ||
| + | ||
| +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, | ||
| +INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A | ||
| +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
| +HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
| +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
| +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
61
README.md
| @@ -0,0 +1,61 @@ | ||
| +makemeasandwich.js | ||
| +========================== | ||
| +This is a Node.js application that is capable of ordering a Jimmy John's sandwich via command line, bringing to life this legendary XKCD comic. | ||
| + | ||
| + | ||
| + | ||
| +It does this through the combination of Node.js + PhantomJS along with some other command line prompt tools that makes ordering a sandwich even more freaky fast. | ||
| + | ||
| +Installation | ||
| +--------------------------- | ||
| +To install this application on your computer, you can simply use NPM to install it as a global command. | ||
| + | ||
| +``` | ||
| +npm install -g makemeasandwich | ||
| +``` | ||
| + | ||
| +Usage | ||
| +--------------------------- | ||
| +To run this command, simply type it in your terminal. | ||
| + | ||
| +``` | ||
| +makemeasandwich | ||
| +``` | ||
| + | ||
| +Or, if you want to stay true to the comic... | ||
| + | ||
| +``` | ||
| +sudo makemeasandwich | ||
| +``` | ||
| + | ||
| +This will then walk you through the login process, as well as sandwich selection process, and even checkout... all through the command line. You can also provide configurations to make each order super simple. This is done via a JSON file that you can pass into the application using the ```o``` argument like so. | ||
| + | ||
| +``` | ||
| +sudo makemeasandwich -o order.json | ||
| +``` | ||
| + | ||
| +This order json file looks like the following... | ||
| + | ||
| +``` | ||
| +{ | ||
| + email: 'me@example.com', | ||
| + sandwich: { | ||
| + name: 'Country Club', | ||
| + no: [ | ||
| + 'tomatoes', | ||
| + 'lettuce' | ||
| + ], | ||
| + add: [ | ||
| + 'mayo' | ||
| + ], | ||
| + other: [ | ||
| + 'cut in half' | ||
| + ] | ||
| + }, | ||
| + charge: { | ||
| + name: 'My Visa' | ||
| + } | ||
| +} | ||
| +``` | ||
| + | ||
| +The charge settings are simply the pre-defined credit card settings that Jimmy Johns already keeps for you in their system. The first time you create an order, you will need to put in your credit card information which it will simply prompt you for it. |
23
config.json
| @@ -0,0 +1,23 @@ | ||
| +{ | ||
| + "email": "", | ||
| + "company": "AllPlayers.com", | ||
| + "address": "14665 Midway Road", | ||
| + "apt/suite": "220", | ||
| + "city": "Addison", | ||
| + "state": "Texas", | ||
| + "zip": "75001", | ||
| + "sandwich": "country club", | ||
| + "who": "Travis", | ||
| + "bread": "French Bread", | ||
| + "cut": true, | ||
| + "drink": "", | ||
| + "chips": "Regular Jimmy Chips", | ||
| + "cookie": "", | ||
| + "pickle": "", | ||
| + "Tomato": "NO", | ||
| + "tip": "2", | ||
| + "billing_address": "", | ||
| + "billing_city": "", | ||
| + "billing_state": "", | ||
| + "billing_zip": "" | ||
| +} |
Oops, something went wrong.
0 comments on commit
a0ce7d3