ge-ku / AutoJoin-for-SteamGifts

Automatically enters giveaways from Steamgifts.com
https://chrome.google.com/webstore/detail/autojoin-for-steamgifts/bchhlccjhoedhhegglilngpbnldfcidc
GNU General Public License v2.0
105 stars 22 forks source link

Move everything to correct folders #25

Closed tkulpa closed 6 years ago

tkulpa commented 6 years ago

I put files in the appropriate folders, checked autoentry and it worked, i didnt touch compile.sh file. I think next step is to remake files to modules and introduce eslint

ge-ku commented 6 years ago

This breaks compile script, I'll try to fix it later. As for modules, as far as I know browsers still don't support them (you have to manually enable it in chrome:flags for Chrome or about:config for Firefox). I'd like to keep things simple and avoid using polyfills. As for ESLint - I've never used it, I'll check it out. Thanks.

ge-ku commented 6 years ago

Just added ESLint to this branch https://github.com/ge-ku/AutoJoin-for-SteamGifts/commit/6ab8ea0d9263154d47b1ea2d4ef7dcc927bfe710 Cool stuff!

ge-ku commented 6 years ago

I just merged that branch into this one and moved files into directories (it had conflicts, so couldn't just merge this pull request). About your previous suggestion to start using array of objects representing giveaways, what do you think is the best way to accomplish it keeping a link between these objects and corresponding DOM elements?

tkulpa commented 6 years ago

Parse site once every time user opens/refresh it and scrap all needed data to object(new Giveaway(...)), dont store dom elements

ge-ku commented 6 years ago

But then how do we call methods of Giveaway objects on click of buttons besides each giveaway? Search for corresponding object (by giveaway code) each time?

tkulpa commented 6 years ago

This will be separate thing, all actions will be standalone but background join and autojoin will depend on scraped objects

ge-ku commented 6 years ago

That would be fine for background autojoin (and it's basically how it is now) but for autojoin button - it should update DOM elements dynamically. Ideally there it's some kind of binding between DOM elements and objects, at least in my mind. But I'm not sure what is the best way to approach this.