Comments (12)
When you start the script, a new chrome instance/window should open where everything happens.
from giveaway-grabber.
from giveaway-grabber.
Ah yeah, you'll have to tweak the code slightly to give you time to enter your code. In index.js, something like:
//sign in
await signIn(page, username, password);
//wait here until user submits two factor auth code
const twoFactorAuthPromise = page.waitForNavigation();
await twoFactorAuthPromise;
//go to giveaways
I haven't tried that, but I'm pretty sure that would do it.
from giveaway-grabber.
Tried the code...it sat on the giveaway page....terminal showed:
famewolf@hp810-135qe ~/giveaway-grabber $ npm start
[email protected] start /home/famewolf/giveaway-grabber
node index.js
Page 1 Start:
giveaway 1 did not exist?
giveaway 2 did not exist?
giveaway 3 did not exist?
giveaway 4 did not exist?
giveaway 5 did not exist?
giveaway 6 did not exist?
giveaway 7 did not exist?
giveaway 8 did not exist?
giveaway 9 did not exist?
giveaway 10 did not exist?
giveaway 11 did not exist?
giveaway 12 did not exist?
giveaway 13 did not exist?
giveaway 14 did not exist?
giveaway 15 did not exist?
giveaway 16 did not exist?
giveaway 17 did not exist?
giveaway 18 did not exist?
giveaway 19 did not exist?
giveaway 20 did not exist?
giveaway 21 did not exist?
giveaway 22 did not exist?
giveaway 23 did not exist?
giveaway 24 did not exist?
No more pages! Goodbye!
There were plenty there.
//sign in
await signIn(page, username, password);
//wait here until user submits two factor auth code
const twoFactorAuthPromise = page.waitForNavigation();
await twoFactorAuthPromise;
//go to giveaways
let url = 'https://www.amazon.com/ga/giveaways';
if (args.page) {
from giveaway-grabber.
See comment: #15 (comment)
from giveaway-grabber.
@famewolf Just published fix for #15, give this another try and let me know if you are still have problems.
I should think about adding this change as under a flag so everyone can use two factor auth if they want....
from giveaway-grabber.
It works however initially it crashed because I took to long to enter the code....the average user is going to need time to grab their phone..open the app..enter their pin and then enter the code so you may need to adjust the delay if you make this a feature. Really nice! You'd also want to check the "Don't ask for 30 days" checkbox on the 2 party screen.
*original error before I tried 2nd time:
[email protected] start /home/famewolf/giveaway-grabber
node index.js
(node:9936) UnhandledPromiseRejectionWarning: TimeoutError: Navigation Timeout Exceeded: 30000ms exceeded
at Promise.then (/home/famewolf/giveaway-grabber/node_modules/puppeteer/lib/FrameManager.js:1276:21)
at
-- ASYNC --
at Frame. (/home/famewolf/giveaway-grabber/node_modules/puppeteer/lib/helper.js:144:27)
at Page.waitForNavigation (/home/famewolf/giveaway-grabber/node_modules/puppeteer/lib/Page.js:644:49)
at Page. (/home/famewolf/giveaway-grabber/node_modules/puppeteer/lib/helper.js:145:23)
at /home/famewolf/giveaway-grabber/index.js:28:40
at
at process._tickCallback (internal/process/next_tick.js:188:7)
(node:9936) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:9936) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
from giveaway-grabber.
Thanks. I'll create a new ticket for adding this feature. I think you can increase the default timeout like:
const twoFactorAuthPromise = page.waitForNavigation({ timeout: 60000 }); //60 seconds instead of 30
from giveaway-grabber.
Just published new release with optional support for two factor authentication (see readme).
from giveaway-grabber.
Working great "as we speak" although the "npm -- -2fa" is a little awkward. I'll stick it in an alias and be good to go. Thank you!
from giveaway-grabber.
Have you considered adding these as additional entries to .env vs command line parms?
User=blah
Password=blah
2FA=Yes
KINDLE=No
from giveaway-grabber.
user and password are already in the .env file, see the .env.example. I guess I could add the 2FA one as well, I was just lazy.
from giveaway-grabber.
Related Issues (20)
- Alias does not work when Git is installed HOT 1
- Bug on numerical password HOT 2
- Winning and W CODE NOT IN DATABASE HOT 5
- unable to revisit any winning URL HOT 3
- Is it possible to add support for http proxy with authentication? HOT 1
- Unable to install giveaway-grabber HOT 1
- When navigating to next page program gets stock and HOT 2
- Unable to install HOT 1
- Winning Item Url broken
- Multiple accounts at once? HOT 1
- Black Screen HOT 2
- Chrome Executable path still not showing up HOT 1
- Can't find the config file in directory to be able to point to chrome HOT 2
- Idea: Shutdown when done
- Will not access chrome executable path
- Check permissions error HOT 1
- bad luck? HOT 6
- End of the Road HOT 2
- My issue is giveaways are ending.
- October 2019 - 4.3.0 Broken
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from giveaway-grabber.