This git repo is the source code for the app from https://kahoot-win.herokuapp.com
To use, clone this repository, and run:
npm install
When run, it will create an electron window and run the app at localhost:2000, or at whatever port is set in the global environment variable PORT
You may modify the code to remove the electron stuff.
Important: The latest version uses recaptcha v3
- You need to create a recaptcha account and add your site domain (unless you are just using it as localhost)
- This means that you need to modify
index.html
andindex.js
to use your recaptcha public keys
The app doesn't actually verify the requests, so you can actually just remove all things related to recaptcha
Remember to give credit to theusaf for this.
- At least 1GB RAM. If you only have 512 MB, you will need to make changes to store the database in disk instead of memory.
- At least 200 MB. (This requirement may change in the future, ~500MB is recommended.)
- Suggested packages:
- quick.db (storage in file system)
- json-stream (StreamObject - minimal memory usage to loop through the JSON database from archive.org)
- Examples to come later.
Alternatively, I have uploaded various versions of the files in archive.org
full-export.json
(The full JSON object with all the kahoots.)full-export-sectioned.json
(The full JSON object, split into 255 parts ("00" - "ff").)full-export-keys.json
(The list of keys to use.)full-export-keys-sectioned.json
(The list of keys to use, grouped by question amount)json.zip
A zip file with sub files (00 - ff) containing json quiz objects. (Files stored in a folder named "json")json-full.zip
A zip file containing all items. (Stored in a folder named "json-full")
Simply append --disable-electron
when starting the app:
node kahoot.js --disable-electron
OR
- Comment out lines 1-4.
/*let electron;
if(!process.argv.includes("--disable-electron")){
electron = require("electron");
}*/
const compression = require("compression");
...
- Remove electron application functions
- (the lines that looks like these)
function createWindow () { // Create the browser window. let win = new electron.BrowserWindow({ width: 1000, height: 700, webPreferences: { nodeIntegration: true } }) // and load the index.html of the app. win.loadURL('http://localhost:2000'); } electron.app.whenReady().then(createWindow); electron.app.on('window-all-closed', () => { // On macOS it is common for applications and their menu bar // to stay active until the user quits explicitly with Cmd + Q if (process.platform !== 'darwin') { electron.app.quit(); } }); electron.app.on('activate', () => { // On macOS it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. if (electron.BrowserWindow.getAllWindows().length === 0) { createWindow(); } });
- You are all set! You might want to make a few changes:
npm uninstall electron
npm uninstall electron-builder
- in
package.json
changestart
tonode kahoot.js
- Simply follow the steps above for non-gui devices
- Then create a
Procfile
web: node kahoot.js
- Publish your site and start winning!