Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. //------------graph.js-----------
  2.  
  3. var config = require('./config')
  4. var plotly = require('plotly')("BorisBot", config.plotlyApiKey);
  5.  
  6. var graph = {};
  7.  
  8. graph.demo = function() {
  9. var data = [{x:[0,1,2], y:[3,2,1], type: 'bar'}];
  10. var layout = {fileopt : "extend", filename : "nodenodenode"};
  11.  
  12. plotly.plot(data, layout, function (err, msg) {
  13. if (err) return "Not Found";
  14. return msg;
  15. });
  16. };
  17.  
  18. module.exports = graph;
  19.  
  20.  
  21. //--------server.js-----------
  22.  
  23. //...
  24. //...
  25.  
  26. // Run test sequence
  27. request(cfg.tgApiUrl + '/getMe', function (error, res, body) {
  28. console.log('I Am', body);
  29. });
  30. commander.sendMessage(cfg.allowedGroups.testChatId, 'Reboot! ' + Date() + '\nWebhook set to ' + cfg.webhookUrl);
  31. commander.sendMessage(cfg.allowedGroups.testChatId,"Graph demo: " + graph.demo());
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement