b0VIM 7.2PM0qflobyDesmond~floby/dev/node/meme/bin/app.jsutf-8 3210#"! Utpg{ad `FkO1 } X + l '  > t _ ] \ X 2 /    X  }TIuJ?& o)n865 nZXW- x_/T } process.exit(); console.log('http://memegenerator.net/%s', name); var name = meme_generator.memes[sym].template_name; var sym = process.argv[3];if(process.argv[2] === 'view') {// if one wants to see what a given meme is} process.exit(); } console.log(str); str += 'first line: '+m.first_line; if(m.first_line) var str = format("%-20s %-30s ", key, m.template_name); m = meme_generator.memes[key]; for(var key in meme_generator.memes) {if(process.argv[2] === '--list') {// list available memes when asked for it} process.exit(); console.log("meme [GENERATOR|--list] LINE [ADDITIONAL_LINES]");if(process.argv.length < 3) {// print usage when no arguments are provided// parse args and then do things// beginning program} memes: require('../lib/config').parseMemes(maker) // meme SPARTA 'this is' 'Data!' // I could do the trick with the user agent thing. CAN HAZ MOTIVATION? //url: url.parse('http://localhost:3000/Instance/CreateOrEdit'), url: url.parse('http://memegenerator.net/Instance/CreateOrEdit'), version: '0.1.0',var meme_generator = { */ * general info/**} return res res.first_line = first_line; res.template_name = template_name; res.id = id; } fetch(data, cb); }; data['text'+i] = arguments[i]; for (var i = 0; i < arguments.length; ++i) { if(first_line && !line2) [].unshift.call(arguments, first_line); // TODO: improve this // add the default first line as first argument }; generatorName: template_name templateID: id, templateType: types[type] || 'AdviceDogSpinoff', var data = { // construct the data to post var cb = [].pop.call(arguments); // arguments is no real array var res = function(line1, line2) { // page and looks for the link // return a closured function that fetches the linkfunction maker (type, id, template_name, first_line) { */ * two lines of text only * * creates an advice-dog type of meme/**} vert: 'Vertical' adv: 'AdviceDogSpinoff',var types = {} req.end(post+'\n'); }); callback(null, 'http://'+url.host+res.headers.location+'.jpg'); // we can assume that the image url is this // thanks to the fine url rewriting rules at memegenerator // we couldn't care less about the data } return callback(new Error("No location header")); if(!res.headers.location) { } return callback(new Error("Got error "+res.statusCode)); if(res.statusCode !== 302) { res.setEncoding('utf8'); req.on('response', function(res) { req.on('error', function(error) { req.on('error', callback); // send all errors to the global handler var req = http.request(options); }; 'Content-Type': 'application/x-www-form-urlencoded' // do NOT forget this options.headers = { }; method: 'POST', path: url.pathname, port: url.port || 80, host: url.hostname, var options = { var post = qs.stringify(data); // stringify into urlencoded var url = meme_generator.url; // this is a JSON objectfunction fetch (data, callback) {var format = require('sprintf').sprintf;var url = require('url');var qs = require('querystring');var http = require('http');// requires// if you're looking for an entry point, begin reading at line 91#!/usr/bin/env nodead vN#kB4  =  meme_generator.memes[symbol].apply(null, text);// basically, find the function associated with a meme and call it// this has to be the most complicated line of all this}) console.log(link); } process.exit(2); // useless as long as we keep throwing errors throw(err); if(err) {text.push(function callback(err, link) {// add the callback as last arguments see last line} process.exit(1); console.error('use `meme list` to see what is available'); console.error('unknown meme %s',symbol); // haha! you thought I was that dumb ?if(!(symbol in meme_generator.memes)) {var text = process.argv.slice(3);var symbol = process.argv[2]; // the DEFINE-style name of the meme -> V_BABY// that was the easy partad3gND e1  Y V < 8   8  { p 8  q f M G   { e  v][ZB! |zZ(W6 [A;'%$J643} process.exit(); console.log('http://memegenerator.net/%s', name); var name = meme_generator.memes[sym].template_name; var sym = process.argv[3];if(process.argv[2] === 'view') {// if one wants to see what a given meme is} process.exit(); } console.log(str); str += 'first line: '+m.first_line; if(m.first_line) var str = format("%-20s %-30s ", key, m.template_name); m = meme_generator.memes[key]; for(var key in meme_generator.memes) {if(process.argv[2] === 'list') {// list available memes when asked for itmeme_generator.memes = require('../lib/config').parseMemes(maker);// moved this here for performance} process.exit(); console.log(meme_generator.version);if(/^(-v|(--)?version)$/.test(process.argv[2])) {// print version when asked for} process.exit(); console.log("meme [GENERATOR|--list] LINE [ADDITIONAL_LINES]");if(process.argv.length < 3) {// print usage when no arguments are provided// parse args and then do things// BEGIN MASTER PROGRAM} //require this later //memes: require('../lib/config').parseMemes(maker) // meme SPARTA 'this is' 'Data!' // I could do the trick with the user agent thing. CAN HAZ MOTIVATION? url: url.parse('http://memegenerator.net/Instance/CreateOrEdit'), version: '0.1.2',var meme_generator = { */ * general info/**} return res res.first_line = first_line; res.template_name = template_name; res.id = id; // attach some data to help displaying lists } fetch(data, cb); }; data['text'+i] = arguments[i]; for (var i = 0; i < arguments.length; ++i) { if(first_line && !line2) [].unshift.call(arguments, first_line); // TODO: improve this // add the default first line as first argument }; generatorName: template_name templateID: id, templateType: types[type] || 'AdviceDogSpinoff', var data = { // construct the data to post var cb = [].pop.call(arguments); // arguments is no real array var res = function(line1, line2) { // page and looks for the link // return a closured function that fetches the linkfunction maker (type, id, template_name, first_line) { */ * two lines of text only * * creates an advice-dog type of meme/**} vert: 'Vertical' adv: 'AdviceDogSpinoff',var types = {} req.end(post+'\n'); }); callback(null, 'http://'+url.host+res.headers.location+'.jpg'); // we can assume that the image url is this // thanks to the fine url rewriting rules at memegenerator // we couldn't care less about the data } return callback(new Error("No location header")); if(!res.headers.location) { } return callback(new Error("Got error "+res.statusCode)); if(res.statusCode !== 302) { res.setEncoding('utf8'); req.on('response', function(res) {