• Stars
    star
    963
  • Rank 46,417 (Top 1.0 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 11 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Node.js + Phantom.js command line application that will automatically order you a sandwich from Jimmy John's. ( http://xkcd.com/149 )

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.

Article

To read more about this project and why I built it, go to http://travistidwell.com/blog/2013/09/01/sudo-make-me-a-sandwich

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": "",
  "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": "123 Main St.",
  "billing_city": "Carrollton",
  "billing_state": "Texas",
  "billing_zip": "75007"
}

If you'd like to save the order json for repeated use, simply add it to either X:\mmas\config.json in Windows (where X is your primary drive letter) or /etc/mmas/config.json in Linux/Mac. However, do note that using -o order.json will override the saved config.json.

Using the Makefile

If you navigate to the downloaded folder within your terminal, you can then use the Makefile to type the command as it is in the XKCD comic.

sudo make me a sandwich

Debugging & Troubleshooting

You can provide a debug argument which it will capture a screenshot within the "screenshots" folder for every step in the process. This is a good way for you to see what exactly the script is doing as it is doing it, as well as debug if any issues occur.

sudo makemeasandwich -o myorder.json --debug

More Repositories

1

jsencrypt

A zero-dependency Javascript library to perform OpenSSL RSA Encryption, Decryption, and Key Generation.
JavaScript
6,537
star
2

seamless.js

A Javascript library for working with seamless iframes.
JavaScript
215
star
3

meanapp

An example M.E.A.N web application with full CRUD features.
ApacheConf
162
star
4

jquery.go.js

An easy-to-use web testing and automation tool that uses the jQuery interface within Node.js to interact with the Phantom.js browser.
JavaScript
150
star
5

resourcejs

An minimalistic Express.js library that will reflect a Mongoose model onto a RESTful interface with a splash of Swagger.io love.
JavaScript
115
star
6

jquery.treeselect.js

A minimalistic jQuery hierarchy select widget used for selecting hierarchy structures in a treeview format.
JavaScript
101
star
7

drupal.api.js

An object oriented JavaScript API Library for RESTful Drupal CMS.
JavaScript
55
star
8

zombie-phantom

Provides a Zombie.js shim around the Phantom.js Headless Browser.
JavaScript
51
star
9

presentations

A list of all my presentations.
JavaScript
48
star
10

minplayer

A minimalistic, plugin-based "core" media player for the web.
JavaScript
24
star
11

dartminer

A Bitcoin miner written in the Dart language.
Dart
20
star
12

drupal.go.js

A node.js package to automate and test Drupal using the Phantom.js headless browser.
JavaScript
16
star
13

mediafront_demo

A demo Drupal 7 site to show off the mediafront module.
12
star
14

zerotomean

The example application for 0 to M.E.A.N presentation
JavaScript
10
star
15

flatiron-passport

A Passport.js integration with the Flatiron.js web framework.
JavaScript
10
star
16

groupselfie

A web application that allows you to take Group Selfies
JavaScript
9
star
17

drupaltouch

A Sencha Touch application for Drupal CMS
JavaScript
8
star
18

drupal_multimedia

A Drupal 8 with multimedia support.
PHP
7
star
19

youtube_playlist

This is an example jQuery Mobile widget for showing YouTube Playlists. Go to http://www.youtube.com/watch?v=RlrJthCmmU8 to watch the presentation.
JavaScript
6
star
20

ResultTree

A PHP class that will take a flat parent-child mapping array, and build a result tree non-recursively.
PHP
6
star
21

limelight

A PHP library for integrating with Limelight CDN
PHP
5
star
22

restPHP

A couple of simple helper classes to help in writing RESTful PHP Libraries.
PHP
5
star
23

pivotalphp

This is a GPLv3 PHP-CLI script for Pivotal Tracker
PHP
5
star
24

formiomean

An example M.E.A.N app using Angular 4 + Form.io
TypeScript
5
star
25

juckstrap

Unfortunately named static site generation utilizing Nunjucks + Bootstrap + Wintersmith.js.
JavaScript
4
star
26

cliphp

An easy to use CLI ( command line interface ) PHP class that allows for user input.
PHP
4
star
27

phptoolbox

The PHP Toolbox is a convenient way to execute and manage your PHP scripts.
PHP
3
star
28

jekyll-kickstart

A starter Jekyll site using BootStrap 3
JavaScript
3
star
29

travist.github.com

My github pages site.
HTML
3
star
30

media_feature

A Drupal 7 media feature module.
PHP
3
star
31

CachedRequest

An extension to PEAR's HTTP_Request2 class that implements extensible caching mechanisms.
PHP
3
star
32

ropemaze

The rope maze puzzle solved using brute force.
JavaScript
3
star
33

minplayer-flash

An MIT licensed, minimalistic, skinnable, plugin based Flash media player
ActionScript
3
star
34

clicpp

This is a helper class to assist with creating command line applications in C++ where you can easily gather settings for your application.
C++
2
star
35

rotating_banner_pan

A plugin for Drupal's Rotating Banner module that implements panning.
JavaScript
2
star
36

CCK

Content Construction Kit Clone
PHP
2
star
37

drupal-zombie

A presentation and examples for "Automating and Testing Drupal with Zombie.js"
JavaScript
2
star
38

pdfjs-viewer

A built bower version of PDFJS
JavaScript
2
star
39

fpManager

A plugin manager for Flash applications.
ActionScript
2
star
40

moviemate

A Chrome extension that merges functionality between YouTube Trailers and IMDB.
JavaScript
2
star
41

jquery.moreorless.js

A quick way to add "more" or "less" functionality to HTML elements using jQuery.
JavaScript
2
star
42

JQImage.js

A jQuery widget and wrapper class for working with Images.
JavaScript
2
star
43

limelight.js

A node.js application for authenticating Limelight API requests.
JavaScript
1
star
44

drupal-media-module

This is the Drupal Media module with media player integration.
JavaScript
1
star
45

generator-juckstrap

A Yeoman generator for juckstrap.
JavaScript
1
star
46

async-shell

A super simple async shell for Node.js
JavaScript
1
star