Open nitroxplunge opened 7 years ago
Really? I was thinking of useing this package to create an app, but if not...
Was working on a project with this, figured out that the NPM package was way behind in version, replace the files in node_modules and changed a few lines of code, then it worked!
Awesome! Thanks! What exactly did you "change"?
I first installed the package with npm install kahoot.js --save
in the directory I was working in, I then downloaded the latest version of this repository and in node_modules I went into the kahoot.js directory and deleted all the files inside, replacing them with the files I downloaded from the repository. You will have leftover files from the repository, they aren't needed. Upon trying to run it you will get an error, I don't remember the exact error but once it happens go to the line of code where the error occurs and replace it with something that wont cause the error, I'm pretty sure I just commented it out.
Hope this helps.
I am also attempting to use this, but I don't understand the steps taken in the last comment, because I do not know where the error is taking place. Any help would be greatly appreciated. The error I get is:
undefined:2
var _ = { replace: function() { var args = arguments; var str = arguments[0]; return str.replace(args[1], args[2]); }}; var log = function(){};return decode.call(this, 'wKBTXPG1wf86AhxstjwUTv3uQW36fojtIWx0BTporcCRWJAyOE8F5OTMFNyrlVQxbbhp3GzsjmSme8uGOuuTJK39oxpoQoNnSwnl'); function decode(message) {var offset = ((73 + 41 * 27 + 21) + (56 * 32)) + 11; if (this.angular.isString(offset)) {log("Offset derived as: {", offset, "}");}return _.replace(message, /./g, function(char, position) {return String.fromCharCode((((char.charCodeAt(0) * position) + offset) % 77) + 48);});}
^
TypeError: Cannot read property 'isString' of undefined
at decode (eval at <anonymous> (/home/pi/Kahoot-bot/node_modules/kahoot.js/src/token.js:46:17), <anonymous>:2:373)
at eval (eval at <anonymous> (/home/pi/Kahoot-bot/node_modules/kahoot.js/src/token.js:46:17), <anonymous>:2:161)
at /home/pi/Kahoot-bot/node_modules/kahoot.js/src/token.js:48:13
at Function.solveChallenge (/home/pi/Kahoot-bot/node_modules/kahoot.js/src/token.js:49:5)
at me.requestToken (/home/pi/Kahoot-bot/node_modules/kahoot.js/src/token.js:70:22)
at IncomingMessage.res.on.chunk (/home/pi/Kahoot-bot/node_modules/kahoot.js/src/token.js:33:5)
at emitOne (events.js:125:13)
at IncomingMessage.emit (events.js:221:7)
at IncomingMessage.Readable.read (_stream_readable.js:478:10)
at flow (_stream_readable.js:849:34)
The answer is probably right there but I'm new to all of this ^_^ Thanks in advance, and sorry for bothering you!
Sorry for the late reply, did you change all the files inside the node_modules directory?
I did, but I will try once more once I regain physical access. Thanks for the feedback! ^_^
can someone upload a fixed package to his/her account?
I'll do this once I have the time.
thank you
Any chance you've gotten to it yet, @cooperkilian?
It seems to still work decently. The NPM package hasn't been updated, but you can install directly from GitHub with npm install wwwg/kahoot.js
if you want to save yourself from the trouble of manually replacing the files. Hope this helps!
the question.answer(0)
doesn't work, does anyone have a solution for this?
@lynxmelynx I have the same problem
@casperlofgren do you know what to do? I really need this package ^_^
Last time I checked it answers correctly (check the scoreboard) but it doesn't show during the question. I don't know why this happens, and currently I don't have time to investigate.
@lynxmelynx Testing it I have found the same results as casper, it seems to have to do with a deprecated function on Kahoot's side. I don't know if there's a replacement though.
Late reply, but if you are still using this old kahoot.js package, there are many things outdated with it. It works for the most part, but there are many things missing / broken, which are fixed in my version of this project, which can also be found on npm as "kahoot.js-updated." The reason why kahoot doesn't show the script answering was because the "submit" id was changed from 6 to 45.
Edit: This package no longer works.
It seems that it's not able to join games anymore.