jpchip / giveaway-grabber

Automated Amazon Giveaways using Node & Puppeteer (until 10/17/19) 🎁
MIT License
74 stars 20 forks source link

SyntaxError: Unexpected token in JSON at position 332 #113

Closed kyfho23 closed 5 years ago

kyfho23 commented 5 years ago

When I run the gg command, I am getting SYNTAX ERRORS: Unexpected token

My index.js from C:\Users\Christopher Wetmore\AppData\Roaming\npm\node_modules\giveaway-grabber/index.js :

kyfho23 commented 5 years ago

Hi, let's try this again:

Here's the command I enter and the result:

C:\Users\Christopher Wetmore>gg undefined:8 "blacklist": "women,women's,kindle,headlight,womens,shoes,boots,boot,shoe,garage light,baseball cap,jade roller,puppy,camisole,pet,security camera,straw,skateboard,aquarium,bed rails,projector,sconces,belt,

SyntaxError: Unexpected token in JSON at position 450 at JSON.parse () at Object. (C:\Users\Christopher Wetmore\AppData\Roaming\npm\node_modules\giveaway-grabber\index.js:13:34) at Module._compile (internal/modules/cjs/loader.js:776:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10) at Module.load (internal/modules/cjs/loader.js:643:32) at Function.Module._load (internal/modules/cjs/loader.js:556:12) at Function.Module.runMain (internal/modules/cjs/loader.js:839:10) at internal/main/run_main_module.js:17:11

My .ggrc.json (https://pastebin.com/h7PZD8qQ)

The error message makes reference to: at Object. (C:\Users\Christopher Wetmore\AppData\Roaming\npm\node_modules\giveaway-grabber\index.js:13:34) . That file is here:

https://pastebin.com/884ihBKE

NOTE: The gg.db seems not to have much in it. Pastebin here:

https://pastebin.com/KN4NBKUB

Oh, also, top line in node.js: Your environment has been set up for using Node.js 12.6.0 (x64) and npm. Another note: The blacklist SEEMS to have proper syntax. There's a comma after belt and then the rest of the list.

Sorry, a newbie needs help!

Thank you Christopher Wetmore

victorka143 commented 5 years ago

I hope the user name and password you posted on the link is not your real information if so please change your password immediately for your account safety and don't put that sensitive info there

kyfho23 commented 5 years ago

Ooops.

thank you. Edited.

Chris

On Fri, Jul 12, 2019 at 8:45 AM vahapkalkan notifications@github.com wrote:

I hope the user name and password you posted on the link is not your real information if so please change your password immediately for your account safety and don't put that sensitive info there

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jpchip/giveaway-grabber/issues/113?email_source=notifications&email_token=AB7VURYI2BFFNHDGFO5SGPTP7B4FJA5CNFSM4ICETSHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZZUZ2Q#issuecomment-510872810, or mute the thread https://github.com/notifications/unsubscribe-auth/AB7VUR6NG45HN37C5QXTO4TP7B4FJANCNFSM4ICETSHA .

jpchip commented 5 years ago

It does seem to be an issue with the blacklist. Try copying and pasting it into jsonlint.com and you'll see what errors it is throwing. I think it doesn't like that the blacklist isn't all on one line, and that their is a trailing comma after unfollow updates.

kyfho23 commented 5 years ago

Thanks, Jared.

Are there limits on how many words can be blacklisted?. It seems to work fine if there are none.

Chris

On Fri, Jul 12, 2019 at 11:46 PM Jared Chapiewsky notifications@github.com wrote:

It does seem to be an issue with the blacklist. Try copying and pasting it into jsonlint.com and you'll see what errors it is throwing

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jpchip/giveaway-grabber/issues/113?email_source=notifications&email_token=AB7VUR4T2MXV3D4GMAXFU3DP7FF2BA5CNFSM4ICETSHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ3ITLA#issuecomment-511084972, or mute the thread https://github.com/notifications/unsubscribe-auth/AB7VURYD56PUY5A6AYRR7VLP7FF2BANCNFSM4ICETSHA .

jpchip commented 5 years ago

I don't think there is a limit, but I think to be valid JSON they need to be all in one line

kyfho23 commented 5 years ago

Thanks.

Chris

On Sun, Jul 14, 2019 at 3:58 PM Jared Chapiewsky notifications@github.com wrote:

I don't think there is a limit, but I think to be valid JSON they need to be all in one line

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/jpchip/giveaway-grabber/issues/113?email_source=notifications&email_token=AB7VUR7NGZ6HQWCH7XS7VHDP7OAOHA5CNFSM4ICETSHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZ4MHDY#issuecomment-511230863, or mute the thread https://github.com/notifications/unsubscribe-auth/AB7VUR36GYCONLA53ZLQ3ALP7OAOHANCNFSM4ICETSHA .