wwwg / kahoot.js Goto Github PK
View Code? Open in Web Editor NEWA library for interacting with Kahoot API.
License: MIT License
A library for interacting with Kahoot API.
License: MIT License
does this work?? if not how can i fix it?
It would make things so much easier for me.
EDIT: forgot foreach was a thing, sorry!
Error: Cannot find module 'kahoot.js'
Require stack:
I keep getting "request error: Error: socket hang up" w hen trying to connect
Basically the title. Sometimes, questionStart fires twice.
kahoot.on("questionEnd", questionEnd => { console.log("this is where the question ends"); });
I made a pull request to actually let you know what the error is when this pops up, I did some research and it looks like this happens whenever the room is not accessible or doesn't exist for whatever reason. @wwwg I'd love if you'd merge my pull request that I've linked below :)
Code that will reproduce
(Basically every <Client>.join
event with a room that is not accessible)
var Kahoot = require("kahoot.js");
var k = new Kahoot;
console.log("Joining kahoot...");
k.join(000000, "kahoot.js").then(() => {
console.log("Joined Quiz");
});
Error output
TypeError: First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.
My pull request that will output an error letting you know what is wrong. #10
This has been an issue for a few weeks now, not really sure how to go about fixing this myself as a quick look at dev tools doesn't really lead me to the actual part that is being eval'd
The error in full:
var _ = { replace: function() { var args = arguments; var str = arguments[0]; return str.replace(args[1], args[2]); }}; var log = function(){};return decode.call(this, '3UNFtEEksrRaLp3rsvUCcjiXlve2g5ZmRwAw4tlkN1r7daXo4pdJIimXy9UsMWITgftNCleMTH9FpLMrGNL8GOgXWU4wsRh0LRlS'); function decode(message) {var offset = (59 * 81 * 84 * 39 + 38 + 98); if (this.angular.isObject(offset)) {console.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 'isObject' of undefined
at decode (eval at <anonymous> (/root/hakoot/node_modules/kahoot.js/src/token.js:47:17), <anonymous>:2:363)
at eval (eval at <anonymous> (/root/hakoot/node_modules/kahoot.js/src/token.js:47:17), <anonymous>:2:161)
at /root/hakoot/node_modules/kahoot.js/src/token.js:49:13
at Function.solveChallenge (/root/hakoot/node_modules/kahoot.js/src/token.js:50:5)
at me.requestToken (/root/hakoot/node_modules/kahoot.js/src/token.js:71:22)
at IncomingMessage.res.on.chunk (/root/hakoot/node_modules/kahoot.js/src/token.js:33:5)
at emitOne (events.js:96:13)
at IncomingMessage.emit (events.js:191:7)
at IncomingMessage.Readable.read (_stream_readable.js:383:10)
at flow (_stream_readable.js:763:34)
read below, solved this.
It seems that it's not able to join games anymore.
class Kahoot extends EventEmitter {
^^^^^
SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (/home/ubuntu/workspace/.kahoot/node_modules/kahoot.js/index.js:1:76)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
The kahoot client is unable to join the game. It stops at Joining kahoot...
and never gets past that.
The client.answer(0) doesn't seem to work. I can join. It detects when a question starts, but it just doesn't answer the question. No error. Just nothing. Can somebody help me out?
I've been able to solve the challenge but I don't know what it wants when it says to decode the base 64 string, x-Kahoot-session-token. what is meant by that and how would that be done in JS?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.