Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip Kindle Sweeps option? #22

Closed
famewolf opened this issue Feb 13, 2019 · 25 comments
Closed

Skip Kindle Sweeps option? #22

famewolf opened this issue Feb 13, 2019 · 25 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@famewolf
Copy link

I'm shamelessly stealing this idea from a similar giveaway grabber that doesn't work anymore. I'm thinking the ability to specify to skip the kindle sweeps might be a good way to speed things up as typically the books are things I've never heard of. I'm also wondering if more of this could be specified in the .env vs adding flags?

@jpchip jpchip added enhancement New feature or request help wanted Extra attention is needed labels Feb 13, 2019
@jpchip
Copy link
Owner

jpchip commented Feb 15, 2019

Out of curiosity, can you link to the other giveaway grabber that doesn't work anymore?

@famewolf
Copy link
Author

@famewolf
Copy link
Author

famewolf commented Mar 3, 2019

Giveaways that are for kindle books will have "(Kindle Edition)" in the title.

@famewolf
Copy link
Author

With some of the recent issues you implemented I wonder if now might be a good time to revisit the option to bypass sweeps with the words "(Kindle Edition)" in the title of the item? This will become more important once you implement the auto confirming of mailing address and will speed things up in general by skipping alot of junk.

@famewolf
Copy link
Author

You may want to include sweeps where the item has a retail value of $0.00.

@famewolf
Copy link
Author

Something that might be more versatile might be to have a blacklist the user can add keywords to. This would allow people to bypass items that don't interest them.. (Kindle Edition) being one where another user might pick "Supplement" and/or "Perfume".

@jpchip
Copy link
Owner

jpchip commented Mar 29, 2019

Good idea. I added ability to specify keywords in a blacklist in latest release. I believe that will meet your needs for this ticket. Tested with --blacklist="kindle edition" and it worked great.

When I run it I'm also going to add words like "dog,cat,pet" etc. since I don't have a pet. :p

@famewolf
Copy link
Author

famewolf commented Mar 29, 2019

The only issue I see is you are adding everything as a runtime switch as opposed to using files that would be saved. The user will have to enter their blacklist every time they start it and what if they want to block alot of stuff? It would be much more useful to have it be a 1 time set it and forget it vs every run. Also no mention if it's case sensitive? Picture a 2 or 3 line list of keywords. The user ends up having to run your programs via a script or batch file.

Example: npm start -- --2FA --page=84 --blacklist="Kindle,perfume, nightgown" | tee grabber.log

@jpchip
Copy link
Owner

jpchip commented Mar 29, 2019

You can add them to the env file, https://github.com/jpchip/giveaway-grabber/blob/master/README.md#blacklist

@jpchip
Copy link
Owner

jpchip commented Mar 29, 2019

It's not case sensitive

@famewolf
Copy link
Author

Thank you. Now I just have to start writing down all the keywords as I see the sweeps.

@famewolf
Copy link
Author

Did you test "(Kindle Edition)" or just "kindle?" cause I wanna skip the books but wouldn't mind winning a free Kindle ereader. Not sure if multiword or the Parenthesis will cause issue.

@jpchip
Copy link
Owner

jpchip commented Mar 29, 2019

It supports spaces, and you don't need the parentthesis. I tested "kindle edition" as I mentioned earlier, and it worked great.

@famewolf
Copy link
Author

famewolf commented Mar 29, 2019

Do you have a contributions paypal email? I don't see one in the docs or the project page and would like to buy you a beer/beverage of your choice. Feel like I'm constantly bugging you to add things. ;)

@famewolf
Copy link
Author

Here is a basic starter list. My thought was it might be useful to put into .env.example perhaps commented out?

BLACKLIST="kindle edition,perfume,parfume,nightgown,purse,bra,infant,newborn,toddlers,suppositories,menstrual,menopause,lip tint,fanny pack,hair extensions,hair weave,babydoll,hair curler,pregnancy,maternity,tutu,henné"

@famewolf
Copy link
Author

famewolf commented Mar 29, 2019

Hmm I know you said you tested it using the command line switch but did you also test it using the line in .env? I ask because I just watched it enter a kindle edition sweep and earlier it did one on keyword "infant" both of which should be bypassed by my blacklist. I've seen NO lines in my log showing anything getting bypassed.

Upon restart with --page=21 I also note it's not waiting on me to enter the 2FA code like it was previously:

famewolf@hp810-135qe ~/giveaway-grabber $ gg --page=21 | tee grabber.log
Page 21 Start:
giveaway 1 did not exist?
giveaway 2 did not exist?
giveaway 3 did not exist?

giveaway 4 already entered.
giveaway 5 already entered.
giveaway 6 already entered.
giveaway 7 cannot be entered.
giveaway 8 already entered.
giveaway 9 already entered.
giveaway 10 cannot be entered.
giveaway 11 is ready!
waiting for video (~15 secs)...
could not find video, oh well. Moving on!
giveaway 12 already entered.
giveaway 13 already entered.

Tried it via command line: gg --page=24 --blacklist="kindle edition,perfume,parfume,nightgown,purse,bra,infant,newborn,toddlers,suppositories,menstrual,menopause,lip tint,fanny pack,hair extensions,hair weave,babydoll,hair curler,pregnancy,maternity,tutu,henné,panty,(pink),purse" | tee grabber.log

It again did not wait on the 2FA but gave giveaway not found errors...and then it entered another kindle edition sweep instead of skipping it. gg is a script that has "npm start -- --2FA" in it.

@famewolf
Copy link
Author

Apparently it doesn't like me using a script although even with that I would have thought the .env entries should work.

npm start -- --2FA --page=24 --blacklist="kindle edition,perfume,parfume,nightgown,purse,bra,infant,newborn,toddlers,suppositories,menstrual,menopause,lip tint,fanny pack,hair extensions,hair weave,babydoll,hair curler,pregnancy,maternity,tutu,henné,panty,(pink),purse" | tee grabber.log

Worked as expected but again the .env entries should have worked also?

@jpchip
Copy link
Owner

jpchip commented Mar 30, 2019

Whoa, lots to respond to here!

First, I don't think I want to make those items the default, they are pretty specific to one person and gender's desired items, and I'd like to leave this inclusive. People can choose to enter anything whatever suits their needs, or nothing at all.

Second, I verified that the changes to the .env file work. I added:

BLACKLIST="teeth,headphones,tights,car,otc,hemp,ipad,wireless,eimmie,oplink,earbuds"

which matched words in the first 12 entries on the first page, and it skipped them all as expected. Be sure not to include any blacklist items in your npm start call at the same time as they will override the items in the .env file.

Third, I noticed sometimes the giveaways do not have titles, and instead say something like "1 of 2 prizes awarded, you could be next!" etc. It will still try to enter those no matter what as there is no title to check against.

Fourth, I'll double check that the 2fa check is still working.

Last, thank you for the offer to buy me a beer, that's very kind of you. I set up a ko-fi page: https://ko-fi.com/jpchip

@famewolf
Copy link
Author

No my thought was to have a sample blacklist in the .env.example that is commented out by default....I included mine as an example and yes your right it's gonna be unique for each user however some general ones could be used for starters...most folks will skip the kindle edition stuff as it's usually a book you've never heard of.

Interestingly enough the blacklist as a side benefit seems to have cut down considerably on the amount of capcha's I was having to enter...possibly amazon screening for anyone who enters EVERY sweep in order.

Some of my issues was because I was trying to run the command line from a script to save all the parms vs just running it. 2FA worked fine once I stopped trying to do that. I will clear the blacklist from the command line and see if the .env picks up again. I think it might be helpful to see what keyword triggered a blacklist in the console and might be helpful for debugging purposes farther down the line. Something like Sweep was blacklisted [keyword]. It would help to ensure some entries are not getting accidentally blocked. For example dog folks won't care about cat stuff and vice versa but some of those sweeps have both "cat dog" etc in the title. I happened to see it but it would make issues like that more obvious.

I submitted a donation. I think you should add the info to the readme so others can do likewise. You've put in alot of work on this.

@jpchip
Copy link
Owner

jpchip commented Mar 30, 2019

Thanks so much for the donation! 👍

I like your suggestions. I updated it to spit out the keyword it caught like giveaway 5 is blacklisted [kindle edition].. I also added some commented out placeholders in .env.example, and updated the readme to clarify things a bit for new users.

@famewolf
Copy link
Author

On my latest attempt after moving the blacklist into .env it still seems to not be waiting on 2FA.

famewolf@hp810-135qe ~/giveaway-grabber $ npm start -- --2FA | tee grabber.log

giveaway-grabber@2.6.1 prestart /home/famewolf/giveaway-grabber
npm install --production

giveaway-grabber@2.6.1 start /home/famewolf/giveaway-grabber
node index.js "--2FA"

Page 1 Start:
giveaway 1 did not exist?
giveaway 2 did not exist?
giveaway 3 did not exist?

giveaway 4 is ready!
waiting for box...
Rudi, you didn't win
giveaway 5 is ready!

@famewolf
Copy link
Author

Would cat with a space after it be a better choice over just cat? It would eliminate triggering vacation assuming it would keep the space. I'm looking at potential issues with "bra" as a keyword as well.

@jpchip
Copy link
Owner

jpchip commented Mar 30, 2019

Just turned on my own 2fa and tested npm start -- --2FA and it waited for me, not sure why it's not waiting for you. :(

Right now 'cat ' isn't any different than 'cat', as I'm trimming the strings, sorry. It's a pretty simple implementation. I'm sure it could be improved with some regex, something to look into at some point.

@famewolf
Copy link
Author

famewolf commented Mar 31, 2019

Just figured out the 2FA situation a bit more...here is the specific situation where it did not wait. Your program tried to login and amazon returned the password AND capcha page. I entered both and clicked signin..I was then presented with 2FA page to enter code. From the Time the 2FA page came up to when I could enter the code the program attempted to enter 4 sweeps on page 1(Giveaway x not found). Now I just ran it as "normal" with the 2FA code and it waited as you mentioned so it's only in the previous circumstance. It's a shame you are stripping the spaces...I would just separate by the command and grab the strings asis. Anyway I ended up having to pull "bra" and a few others that ended up blocking unexpected sweeps.

A similar issue happens with the "normal" 2FA route is the user enter the wrong code or one that just expired.

@jpchip
Copy link
Owner

jpchip commented Mar 31, 2019

Created new issues for the two issues described above so that they won't get lost.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants