GithubHelp home page GithubHelp logo

thiscatlikescrypto / extinguishedspark Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 257 KB

Will be a sparx solver maybe at some point

License: Do What The F*ck You Want To Public License

Python 39.57% JavaScript 53.54% HTML 6.89%

extinguishedspark's Introduction

Extinguished Spark

A program designed to get around Sparx Mathsβ„’ bookwork checks by taking a screenshot every time you press a certain key/key combo (thus taking a picture of your answer)

Why are there two?

I made the python one first and then got ChatGPT to make an extension ver (it took a lot of wrestling and I made quite a lot of it myself in the end but oh well)
Choose which one you want! The extension version is likely to be the most convenient and have updates but if you can't enable developer mode on your browser for whatever reason use the python one.

Extension instructions

Either clone this repo or download the files. Go to your chromium-based browser. On your extensions page (something like brave://extensions/), turn on developer mode with the little toggle at the top if it isn't on already. Move the 'chromeExtension' folder to somewhere on your computer, then select 'Load extension'. Select it, and it should load.
It automatically is given permissions on sparxmaths.uk (as well as my websites for testing) and will take screenshots with Ctrl+Shift+S (Command+Shift+S for mac). I tried to get it to work with enter but it just wasn't having it.

Python instructions

Requires pynput and pyautogui.
Either clone this repo or download the files. Move them to their own folder (along with 'numero'!) and whenever you use sparx simply run main.py. It will take screenshots when you press enter, and explorer.py is a viewer for said screenshots.

Problems?

Make an issue. I'll make an FAQ at some point if I keep getting the same questions.

extinguishedspark's People

Contributors

thiscatlikescrypto avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

cattoyt

extinguishedspark's Issues

General propositions and possible improvements

I skimmed through the code and this part confuses me:

let answers = [];
console.log('Extinguished Spark -> Continue clicked, getting answers');
Array.prototype.forEach.call(answersFromInput, function(answer) {
    answers.push(answer.value);
});

This can be just a .map, you're overcomplicating it significantly.

const answers = document.getElementsByTagName('input').map(answer => answer.value);

should yield identical results.

Additionally, you should consider using a Map class instead of just an object, as this is typically better if the entries inside the data structure will change size.

var answersMap = {};

turns into

var answersMap = new Map();

and

answersMap[bwkCode] = answers;

turns into

answersMap.set(bwkCode, answers);

In general, manipulating and getting answers through the APIs defined on the window is usually not enough, especially considering the website is written in React, not plain HTML + CSS + JS. You may want to consider an approach more similar to this which traverses and patches the React layer instead. This makes getting answers and injecting custom UIs much easier.

Note

This by no means implies you can take all the code 😭 - This seems like a dumb disclaimer but the last time I tried to show this project as a reference I spent half a year trying to get them to take down the code because they took it without credit and claimed it as theirs, I had to resort to a DMCA takedown.

Anyway yeah your project is promising, I like that there is both a Python version and a JS version.

  • Rosie πŸ’ž

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.