├── .gitignore ├── README.md ├── index.html ├── package.json ├── server.js ├── soylent-dick-LED-pump └── soylent-dick-LED-pump.ino └── soylent-flesh-recipe.md /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Soylent Dick 2 | 3 | ![](http://nicole.pizza/img/soylent-dick-nicole.gif) 4 | 5 | Soylent Dick is a phallus made out of Soylent that ejaculates Soylent when you type self-validating praise for Soylent into the browser. 6 | 7 | [More info here](http://nicole.pizza/soylent-dick). 8 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | soylent dick 6 | 7 | 45 | 46 | 47 | 84 | 85 | 86 | 87 |
88 |

Please type the following text into the box to get what you deserve.

89 |
90 | 91 |
92 |
93 |
94 | 95 |

96 | 97 |

98 |
99 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "soylent-dick", 3 | "version": "1.0.0", 4 | "description": "![](http://nicole.pizza/img/soylent-dick-nicole.gif)", 5 | "main": "server.js", 6 | "dependencies": { 7 | "serialport": "^2.0.6", 8 | "fs": "^0.0.2", 9 | "socket.io": "^1.4.5", 10 | "ws": "^1.0.1" 11 | }, 12 | "devDependencies": {}, 13 | "scripts": { 14 | "test": "echo \"Error: no test specified\" && exit 1", 15 | "start": "node server.js" 16 | }, 17 | "repository": { 18 | "type": "git", 19 | "url": "git+https://github.com/nicolehe/soylent-dick.git" 20 | }, 21 | "author": "", 22 | "license": "ISC", 23 | "bugs": { 24 | "url": "https://github.com/nicolehe/soylent-dick/issues" 25 | }, 26 | "homepage": "https://github.com/nicolehe/soylent-dick#readme" 27 | } 28 | -------------------------------------------------------------------------------- /server.js: -------------------------------------------------------------------------------- 1 | // HTTP Portion 2 | var http = require('http'); 3 | var fs = require('fs'); // Using the filesystem module 4 | var httpServer = http.createServer(requestHandler); 5 | httpServer.listen(8080); 6 | 7 | function requestHandler(req, res) { 8 | // Read index.html 9 | fs.readFile(__dirname + '/index.html', 10 | // Callback function for reading 11 | function (err, data) { 12 | // if there is an error 13 | if (err) { 14 | res.writeHead(500); 15 | return res.end('Error loading canvas_socket.html'); 16 | } 17 | // Otherwise, send the data, the contents of the file 18 | res.writeHead(200); 19 | res.end(data); 20 | } 21 | ); 22 | } 23 | 24 | 25 | // WebSocket Portion 26 | // WebSockets work with the HTTP server 27 | var io = require('socket.io').listen(httpServer); 28 | 29 | // Register a callback function to run when we have an individual connection 30 | // This is run for each individual user that connects 31 | io.sockets.on('connection', 32 | // We are given a websocket object in our function 33 | function (socket) { 34 | 35 | console.log("We have a new client: " + socket.id); 36 | 37 | // When this user emits, client side: socket.emit('otherevent',some data); 38 | socket.on('chatmessage', function(data) { 39 | // Data comes in as whatever was sent, including objects 40 | console.log("Received: 'chatmessage' " + data); 41 | 42 | // Send it to all of the clients 43 | socket.broadcast.emit('chatmessage', data); 44 | }); 45 | 46 | socket.on('data', function(data) { 47 | console.log(data); 48 | if (data == 0) { 49 | myPort.write('0'); 50 | } else if (data == 1) { 51 | myPort.write('1'); 52 | } 53 | }) 54 | 55 | 56 | socket.on('disconnect', function() { 57 | console.log("Client has disconnected " + socket.id); 58 | }); 59 | } 60 | ); 61 | 62 | var serialport = require('serialport'); 63 | SerialPort = serialport.SerialPort; 64 | portName = '/dev/cu.usbmodem1411'; 65 | var myPort = new SerialPort(portName, { 66 | baudRate: 9600, 67 | // look for return and newline at the end of each data packet: 68 | parser: serialport.parsers.readline("\n") 69 | }); 70 | 71 | myPort.on('open', showPortOpen); 72 | myPort.on('data', sendSerialData); 73 | myPort.on('close', showPortClose); 74 | myPort.on('error', showError); 75 | 76 | function showPortOpen() { 77 | console.log('port open. Data rate: ' + myPort.options.baudRate); 78 | } 79 | 80 | function sendSerialData(data) { 81 | 82 | } 83 | 84 | function showPortClose() { 85 | console.log('port closed.'); 86 | } 87 | 88 | function showError(error) { 89 | console.log('Serial port error: ' + error); 90 | } -------------------------------------------------------------------------------- /soylent-dick-LED-pump/soylent-dick-LED-pump.ino: -------------------------------------------------------------------------------- 1 | long startTime; 2 | 3 | void setup() { 4 | // put your setup code here, to run once: 5 | Serial.begin(9600); 6 | // Serial.setTimeout(10); 7 | pinMode(11, OUTPUT); 8 | pinMode(A0, OUTPUT); 9 | 10 | } 11 | 12 | void loop() { 13 | // digitalWrite(A0, HIGH); 14 | if (Serial.available() > 0) { 15 | char input = Serial.read(); // read first available byte into a variable 16 | if (input == '0') { // if the variable equals H, or ASCII 72 17 | startTime = millis(); 18 | digitalWrite(11, HIGH); 19 | digitalWrite(A0, HIGH); 20 | } 21 | } 22 | if (millis() - startTime > 3000) { 23 | digitalWrite(11, LOW); 24 | digitalWrite(A0, LOW); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /soylent-flesh-recipe.md: -------------------------------------------------------------------------------- 1 | #Soylent Flesh Recipe 2 | (adapted from [PBS play-doh recipe](http://www.pbs.org/parents/crafts-for-kids/no-bake-play-dough/)) 3 | 4 | ###Ingredients: 5 | 6 parts Soylent powder 6 | 7 | 1 part water 8 | 9 | 3 parts salt 10 | 11 | 2-4 tablespoons of oil 12 | 13 | 14 | ###Instructions: 15 | 1. Pour water into large mixing bowl 16 | 17 | 2. Mix in dry ingredients 18 | 19 | 3. Knead until doughy 20 | 21 | 4. Slowly add in oil until desired consistency and malleability is reached --------------------------------------------------------------------------------