Closed hongalex closed 6 years ago
Closes #11
This is great! Since we only need to show amazon.com for now, refactoring the google searching seems like an overkill. Let's leave it like this for now.
I'll have to test this locally just to be 100% sure the changes work. Once that's done, I'll merge it in.
LGTM, will merge now 👍
Here is proof that this adds the amazon offer when visiting www.amazon.com. The extension on the left (with the colored icon) is my local install, the one on the right (with the gray icon) is the production one. As seen, the local install displays the amazon.com cashback offer.
Since this is a data-related changed, I had to switch a flag in src/background.js
to read the data from a local directory instead of using the hosted production data. This flag can be found here. This flag will always be set to 0 in prod.
Updated cashback data for www.amazon.com is now live! The hosted json can be viewed here.
All users will receive this data automatically. The chrome extension is designed to download the hosted json every hour, so there is no need to make a new release. Within the next hour, all users should be seeing this cashback offer on www.amazon.com! Congrats on your first change :)
Cool, thanks for the help! I'll leave some of the easier issues for future first-timers to pick up, might look into some of the harder ones once I get the chance. Thanks again!
Sounds great, and thank you for your contribution!
First open source pull request that addresses issue #11
Added a file named
fixedInputData.json
in/data/cashback/
for future developers to specify additional fixed cashback offers that might come up. This still has to follow the schema as defined in the cashback schema file. Currently only has Amazon available, since that was mentioned specifically in the issue.One thing I chose to ignore was that due to the way dataProcessor.js handles google search queueing, a search will be performed for user-defined cashback offers as well. I could modify this with a moderate refactor of how searching/search callbacks are handled, but since this file isn't likely to be very large, I left it as is.
Let me know if anything needs work :)