This file contains 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
height: 600 |
This file contains 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
+ show me your pic | |
- ^addMessageProp(icon_url, http://laorquesta.mx/wp-content/uploads/2014/12/bikers-300x225.jpg) Does this make you smile? |
This file contains 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 facts = require("sfacts"); | |
var fs = require("fs"); | |
var worldData = [ | |
'./data/concepts.top', | |
'./data/names.top', | |
'./data/oppisite.tbl', | |
'./data/worlddata/animals.tbl', | |
'./data/worlddata/color.tbl' | |
]; |
This file contains 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 request = require("request"); | |
exports.weather = function(cb) { | |
if (this.message.names) { | |
var location = this.message.names[0] | |
request.get("http://api.openweathermap.org/data/2.5/find?q="+location+"&type=like&units=metric&mode=json", function(err, res, body) { | |
var results = JSON.parse(body); | |
if (results.list.length != 0) { | |
cb(null, "It is " + results.list[0]['weather'][0]['description']); | |
} else { | |
cb(null, "I'm not near a window."); |
This file contains 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
// Run this and then telnet to localhost:2000 and chat with the bot | |
var net = require("net"); | |
var superscript = require("superscript"); | |
var debug = require('debug')("Server"); | |
var options = {}; | |
var facts = require("sfacts"); | |
var factSystem = facts.explore("britfacts"); |
This file contains 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 request = require("request"); | |
debug = require("debug")("Weather Plugin"); | |
exports.weather = function(city, cb) { | |
request.get("http://api.openweathermap.org/data/2.5/find?q="+city+"&type=like&mode=json", function(err, res, body) { | |
// debug("Weather Results", body); | |
var results = JSON.parse(body); | |
if (results.list.length != 0) { | |
cb(null, "It is " + results.list[0]['weather'][0]['description']); | |
} else { |
This file contains 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
// Basic Syntax match, reply | |
+ when I see this | |
- reply with this | |
// Multiple replies, one choosen at random | |
+ when I see this | |
- reply with this | |
- or reply with this | |
// Alternates words in match |
This file contains 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
+ custom function | |
- ^runCode() | |
// When the input "custom function" is seen, we call the function runCode() from the plugin folder. | |
exports.runCode = function(cb) { | |
cb(err, reply); | |
} | |
// Data can also be passed into the function like this: |
This file contains 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
{ createdAt: Sat Sep 27 2014 00:06:54 GMT-0700 (PDT), | |
raw: 'What time did the train leave London ?', | |
clean: 'What time did the train leave London', | |
dict: | |
{ words: | |
[ [Object], | |
[Object], | |
[Object], | |
[Object], | |
[Object], |
This file contains 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
{ createdAt: Fri Sep 26 2014 23:46:15 GMT-0700 (PDT), | |
raw: 'My name is Bill .', | |
clean: 'My name is Bill', | |
dict: { words: [ [Object], [Object], [Object], [Object] ] }, | |
words: [ 'My', 'name', 'is', 'Bill' ], | |
cwords: [ 'My', 'name', 'is', 'Bill' ], | |
taggedWords: | |
[ [ 'My', 'PRP$' ], | |
[ 'name', 'NN' ], | |
[ 'is', 'VBZ' ], |
NewerOlder