Comparing version 3.0.4 to 3.0.5
@@ -15,25 +15,28 @@ // Responds to people on the group wall with cleverbot's response. You have to make an account on the website cleverbot.io to get a valid api user and api key. | ||
login() | ||
.then(function (info) { | ||
var id = info.userId; | ||
bot.create(function (err, session) { | ||
if (err) { | ||
return console.error('Cleverbot error: ' + session); | ||
} | ||
bot.setNick(session); | ||
var evt = rbx.onWallPost(group); | ||
evt.on('data', function (post) { | ||
console.log(post); | ||
if (post.author.id !== id) { | ||
bot.ask(post.content, function (err, response) { | ||
if (err) { | ||
return console.error('Cleverbot error: ' + response); | ||
} | ||
console.log(response); | ||
rbx.post({group: group, message: response}); | ||
}); | ||
.then(function () { | ||
rbx.getCurrentUser() | ||
.then(function (info) { | ||
var id = info.UserId; | ||
bot.create(function (err, session) { | ||
if (err) { | ||
return console.error('Cleverbot error: ' + session); | ||
} | ||
bot.setNick(session); | ||
var evt = rbx.onWallPost(group); | ||
evt.on('data', function (post) { | ||
console.log(post); | ||
if (post.author.id !== id) { | ||
bot.ask(post.content, function (err, response) { | ||
if (err) { | ||
return console.error('Cleverbot error: ' + response); | ||
} | ||
console.log(response); | ||
rbx.post({group: group, message: response}); | ||
}); | ||
} | ||
}); | ||
evt.on('error', function (err) { | ||
console.error(err); | ||
}); | ||
}); | ||
evt.on('error', function (err) { | ||
console.error(err); | ||
}); | ||
}); | ||
@@ -40,0 +43,0 @@ }); |
@@ -0,1 +1,4 @@ | ||
// Dependencies | ||
var parser = require('whacko'); | ||
// Includes | ||
@@ -18,3 +21,3 @@ var http = require('./http.js').func; | ||
clearSession({jar: jar}); | ||
var url = '//api.roblox.com/v2/login'; | ||
var url = '//www.roblox.com/newlogin'; | ||
var post = { | ||
@@ -36,3 +39,3 @@ 'username': username, | ||
var body = res.body; | ||
if (res.statusCode === 200) { | ||
if (res.statusCode === 302) { | ||
if (settings.session_only) { | ||
@@ -45,7 +48,17 @@ var cookies = res.headers['set-cookie']; // If the user is already logged in a new cookie will not be returned. | ||
} | ||
return body; | ||
} else { | ||
throw new Error(body.message); | ||
var errors = []; | ||
var list = parser.load(body)('.validation-summary-errors').find('li'); | ||
for (var i = 0; i < list.length; i++) { | ||
var err = list.eq(i).text(); | ||
if (err.indexOf('Nice to meet you') > -1) { | ||
err = 'User does not exist'; | ||
} else if (err.indexOf('robot') > -1) { | ||
err = 'Captcha'; | ||
} | ||
errors.push(err); | ||
} | ||
throw new Error('Login failed, known issues: ' + JSON.stringify(errors)); | ||
} | ||
}); | ||
}; |
{ | ||
"name": "roblox-js", | ||
"version": "3.0.4", | ||
"description": "A node module that provides an interface for performing actions on ROBLOX, mostly for use with their HttpService feature.", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"_args": [ | ||
[ | ||
{ | ||
"raw": "https://github.com/sentanos/roblox-js.git", | ||
"scope": null, | ||
"escapedName": null, | ||
"name": null, | ||
"rawSpec": "https://github.com/sentanos/roblox-js.git", | ||
"spec": "git+https://github.com/sentanos/roblox-js.git", | ||
"type": "hosted", | ||
"hosted": { | ||
"type": "github", | ||
"ssh": "git@github.com:sentanos/roblox-js.git", | ||
"sshUrl": "git+ssh://git@github.com/sentanos/roblox-js.git", | ||
"httpsUrl": "git+https://github.com/sentanos/roblox-js.git", | ||
"gitUrl": "git://github.com/sentanos/roblox-js.git", | ||
"shortcut": "github:sentanos/roblox-js", | ||
"directUrl": "https://raw.githubusercontent.com/sentanos/roblox-js/master/package.json" | ||
} | ||
}, | ||
"/Users/Josh/Downloads/test5" | ||
] | ||
], | ||
"_from": "git+https://github.com/sentanos/roblox-js.git", | ||
"_id": "roblox-js@3.0.5", | ||
"_inCache": true, | ||
"_location": "/roblox-js", | ||
"_phantomChildren": {}, | ||
"_requested": { | ||
"raw": "https://github.com/sentanos/roblox-js.git", | ||
"scope": null, | ||
"escapedName": null, | ||
"name": null, | ||
"rawSpec": "https://github.com/sentanos/roblox-js.git", | ||
"spec": "git+https://github.com/sentanos/roblox-js.git", | ||
"type": "hosted", | ||
"hosted": { | ||
"type": "github", | ||
"ssh": "git@github.com:sentanos/roblox-js.git", | ||
"sshUrl": "git+ssh://git@github.com/sentanos/roblox-js.git", | ||
"httpsUrl": "git+https://github.com/sentanos/roblox-js.git", | ||
"gitUrl": "git://github.com/sentanos/roblox-js.git", | ||
"shortcut": "github:sentanos/roblox-js", | ||
"directUrl": "https://raw.githubusercontent.com/sentanos/roblox-js/master/package.json" | ||
} | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/sentanos/roblox-js.git" | ||
"_requiredBy": [ | ||
"#USER" | ||
], | ||
"_resolved": "git+https://github.com/sentanos/roblox-js.git#d60bc92d91782357a7dd1348033b4474aaf4dff2", | ||
"_shasum": "e823f3aba2c766a9c5a27003a728376a32a98bf1", | ||
"_shrinkwrap": null, | ||
"_spec": "https://github.com/sentanos/roblox-js.git", | ||
"_where": "/Users/Josh/Downloads/test5", | ||
"author": { | ||
"name": "Joshua Lanese", | ||
"email": "froastj@gmail.com" | ||
}, | ||
"keywords": [ | ||
"roblox", | ||
"bot", | ||
"clans" | ||
], | ||
"author": "Joshua Lanese <froastj@gmail.com>", | ||
"bugs": { | ||
"url": "https://github.com/sentanos/roblox-js/issues" | ||
}, | ||
"dependencies": { | ||
@@ -26,7 +70,25 @@ "bluebird": "^3.4.0", | ||
}, | ||
"description": "A node module that provides an interface for performing actions on ROBLOX, mostly for use with their HttpService feature.", | ||
"devDependencies": {}, | ||
"gitHead": "d60bc92d91782357a7dd1348033b4474aaf4dff2", | ||
"homepage": "https://github.com/sentanos/roblox-js", | ||
"keywords": [ | ||
"roblox", | ||
"bot", | ||
"clans" | ||
], | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/sentanos/roblox-js/issues" | ||
"main": "lib/index.js", | ||
"name": "roblox-js", | ||
"optionalDependencies": {}, | ||
"readme": "# roblox-js\n\n[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)\n\n[![NPM](https://nodei.co/npm/roblox-js.png)](http://npmjs.com/package/roblox-js)\n\n*Execute ROBLOX website actions in node.js*\n\n## About\n\nRoblox-js is a node module that provides an interface for [ROBLOX](http://www.roblox.com) site actions, mostly for use with their HttpService feature.\n\nMost functions are related to group service but there are other general functions as well. The list of main functions is in the contents section, they all have detailed documentation.\n\nTo use this with HttpService simply set up API's on your node server for accessing the functions, you can use the example server outlined in the below example server section as a base. Note that this does not use the latest version of the module and it is recommended you learn how to use the library directly.\n\nThere are also a few example scripts with version 3 support in the [examples](https://github.com/sentanos/roblox-js/tree/master/examples) folder.\n\n## Prerequisites\n\n- [**node.js**](https://nodejs.org/en/download/current/)\n\n## Installation\n\nWith node.js installed simply run: `npm install roblox-js`. That's it!\n\n## Documentation\n\nYou can find the roblox-js wiki with all API documentation [here](https://github.com/sentanos/roblox-js/wiki).\n\n## Example Server\n\nA usable express server utilizing this module is available [here](https://github.com/sentanos/roblox-js-server) and includes a detailed tutorial for setup on a free host as well as Lua scripts for sending requests to the server from in-game.\n", | ||
"readmeFilename": "README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/sentanos/roblox-js.git" | ||
}, | ||
"homepage": "https://github.com/sentanos/roblox-js" | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
}, | ||
"version": "3.0.5" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
97134
3011
72