Last active
          March 24, 2016 15:54 
        
      - 
      
- 
        Save setkeh/dc3c3172c24fcf998b0f to your computer and use it in GitHub Desktop. 
    gitter.js test
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var Gitter = require("node-gitter"); | |
| var gitter = new Gitter(apitokenhere); | |
| gitter.currentUser() | |
| .then(function(user) { | |
| console.log("Your are logged in as:", user.username); | |
| }); | |
| var roomId = roomidhere; | |
| gitter.rooms.find(roomId) | |
| .then(function(room) { | |
| var events = room.streaming().chatMessages(); | |
| var fs = require('fs'); | |
| for (var i = 0; i < events.Length; i++) | |
| { | |
| var eString = events[i]; | |
| fs.appendFile('/tmp/test', eString, function (err) { | |
| if(err) { | |
| return console.log(err); | |
| } | |
| console.log("The file was saved!"); | |
| }); | |
| } | |
| console.log(events); | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment