daily pastebin goal
88%
SHARE
TWEET

Untitled

a guest Feb 14th, 2018 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var socket = io();
  2. var actionItems = []
  3. var beginTakingAction = false
  4.  
  5. var strOut;
  6. socket.on('transcript', function(x) {
  7. var div = $('div.transcription')
  8. div.html(x);
  9. console.log("transcript " + x);
  10. if (!scrolling) {
  11.   div.scrollTop(div[0].scrollHeight);
  12. }  
  13. })
  14.  
  15. socket.on('action', function(x) {
  16.   console.log('sending action',x);
  17.   actionItems.push(x)
  18.   $('div.action').html(actionItems[actionItems.length-1]);
  19.  
  20. })
  21. socket.on('sentiment', function(x) {
  22. sentimentChart.update(x)
  23. })
  24.  
  25. socket.on('nlp', function(x) {
  26. wordLengthDistChart.update(x.wordLenghDist);
  27. posTagDistChart.update(x.posTagDist);
  28. })
  29.  
  30. socket.on('keywords', function(x) {
  31. keywordChart.update(x)
  32. })
  33.  
  34. socket.on('status', function(status) {
  35. $('div.status').html("status: " + status);
  36.  
  37. if (status == "connected") {
  38.   sentimentChart.reset()
  39.   keywordChart.reset()
  40.   wordLengthDistChart.reset()
  41.   posTagDistChart.reset()
  42.   $('div.transcription').html('');
  43. }
  44.  
  45. })
RAW Paste Data
Top