Originally it was here: http://stackoverflow.com/a/11818691/775359
Piece of working code
(I'm sure it will help)
Well... Many things have changes since then and I believe it is worth keeping things up to date :)
| <Response> | |
| <Pause length="4"/> | |
| <Play>http://stefanow.net/stuff/twilio/record/50.wav</Play> | |
| </Response> |
| /* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
| * http://benalman.com/ | |
| * Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
| (function($) { | |
| var o = $({}); | |
| $.subscribe = function() { | |
| o.on.apply(o, arguments); |
| var app = require('express').createServer(), io = require('socket.io').listen(app); | |
| var url = require("url"); | |
| globalsocket = "XXX"; | |
| io.set('log level', 1); // reduce logging | |
| app.listen(3000); | |
| app.get('/', function (req, res) { | |
| res.sendfile(__dirname + '/index.html'); |
| var pageNum = 1; | |
| function interact (page,callback_list) { | |
| console.log("Setting onLoadFinished"); | |
| page.onLoadFinished = function (status) { | |
| // For debugging, log the results and render the page to a temp directory | |
| console.log (status + ":" + pageNum + " Page load complete - " + | |
| page.evaluate(function() { | |
| return document.title + " - " + document.location.href; |
| console.log("Using included jQuery! " + document.location.href + " " + jQuery.fn.jquery); | |
| var $nativeInput; | |
| var totalTextareas = 2; | |
| var eventsAssigned = 0; | |
| $(document).on("keydown.textarea", "textarea", function(e) { | |
| console.log("window keydown: " + e.keyCode); | |
| var $maybeTextarea = $(document.activeElement); |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Capture Photo Resize</title> | |
| <script src="js/canvasresize/jquery-1.7.2.min.js"></script> | |
| <script src="js/canvasresize/jquery.exif.js"></script> | |
| <script src="js/canvasresize/jquery.canvasResize.js"></script> | |
| <script src="js/canvasresize/canvasResize.js"></script> | |
| <script src="js/canvasresize/binaryajax.js"></script> |
| if(e != null && e.type.indexOf("mouse") == -1) | |
| { | |
| counter++; | |
| } | |
| if(counter == 4) | |
| { | |
| debugger; | |
| } |
| var _filename = function() { | |
| var now = new Date(); | |
| return now.getFullYear() + ('0' + now.getMonth()+1).slice(-2) + ('0' + now.getDate()+1).slice(-2) + "-" + now.getTime(); | |
| } |
| // Generated on 2014-01-23 using generator-mobile 0.0.2 | |
| 'use strict'; | |
| var LIVERELOAD_PORT = 35729; | |
| var lrSnippet = require('connect-livereload')({port: LIVERELOAD_PORT}); | |
| var mountFolder = function (connect, dir) { | |
| return connect.static(require('path').resolve(dir)); | |
| }; | |
| // # Globbing | |
| // for performance reasons we're only matching one level down: |
Originally it was here: http://stackoverflow.com/a/11818691/775359
Piece of working code
(I'm sure it will help)
Well... Many things have changes since then and I believe it is worth keeping things up to date :)