muly / product-track Goto Github PK
View Code? Open in Web Editor NEWonline product price and availability tracking
License: MIT License
online product price and availability tracking
License: MIT License
need to troubleshoot and fix . run make test
to reproduce this
--- Failed steps:
Scenario: test product availability # integration_testing/features/web-scraping.feature:2
Then the response should be "amazon_available_product_response.json" # integration_testing/features/web-scraping.feature:8
Error: {Url:http://localhost:8006/mock/amazon_available.html Price:49.99 Availability:true Image: Name:} is not equal to {Url: Price:0 Availability:false Image: Name:}
Scenario: test product availability # integration_testing/features/web-scraping.feature:2
Then the response should be "amazon_unavailable_product_response.json" # integration_testing/features/web-scraping.feature:8
Error: {Url:http://localhost:8006/mock/amazon_unavailable.html Price:0 Availability:false Image: Name:} is not equal to {Url: Price:0 Availability:false Image: Name:}
Scenario: test product availability # integration_testing/features/web-scraping.feature:2
Then the response should be "flipkart_available_product_response.json" # integration_testing/features/web-scraping.feature:8
Error: {Url:http://localhost:8006/mock/flipkart_available.html Price:123 Availability:true Image: Name:} is not equal to {Url: Price:0 Availability:false Image: Name:}
Scenario: test product availability # integration_testing/features/web-scraping.feature:2
Then the response should be "flipkart_unavailable_product_response.json" # integration_testing/features/web-scraping.feature:8
Error: {Url:http://localhost:8006/mock/flipkart_unavailable.html Price:0 Availability:false Image: Name:} is not equal to {Url: Price:0 Availability:false Image: Name:}
Scenario: test product availability # integration_testing/features/web-scraping.feature:2
Then the response code should be 406 # integration_testing/features/web-scraping.feature:9
Error: 405 is not equal to 406
is the activeTab
permission not good enough? do we also need the tabs
permission?
this will be backup option to use when the scraping fails to get the data
tables:
track_request
when user click the extension, a popup should be shown with below options
and a submit button.
when submitted, the respective API should be called depending on if the user selected the track availability
option or track price
using cucumber/karate tests
monthly email with the table of unsupported website host, followed by count of number of requests attempted, in the decreasing order of the count.
create a go project template repo based of github.com/muly/product-track repo to be used to create new gcp app engine based golang application from this template using gonew
command.
resources to explore:
Version: 1.1.1
Status: Rejection
Violation date: Dec 21, 2023
Violation type: Spam and Placement in the Store
Details:
Acceptance criteria
[POST] /track/availability:
input:
output: http status only
[POST] /track/price
input:
output: http status only
[POST] /product
input:
output:
router library: julienschmidt/httprouter
this is to avoid sending repeated notification whenever the cron job run.
cron job: https://console.cloud.google.com/cloudscheduler?project=smuly-test-ground
new endpoint: [POST] /execute-request
track_requests
table and executes the track availability or track price requests and triggers the notification (not in the scope of this task, for now just call a dummy send notification function that just logs)some pointers:
current: our extension doesnot support the given url
new:
Product Tracking app doesn't (yet) support tracking products on www.amazon.com
Product Tracking app doesn't (yet) support tracking products on www.azurestandard.com
design: TBD
design questions:
to which email address the notification to be sent?
where to save this email address in the database?
scenario:
google pixel
and select the google pixel 7a 5g and request the track request.google pixel 7a 5g
and select the google pixel 7a 5g and request the track request.the url for these two instances will be different even though the product is same.
for example:
https://www.amazon.in/Pixel-Sea-8GB-128GB-Storage/dp/B0CMHLNVGS/ref=sr_1_4?crid=29M7LBVDXVQCP&keywords=google+pixel+7a+5g&qid=1700846878&sprefix=google+pixel+7a+5g%2Caps%2C159&sr=8-4
https://www.amazon.in/Pixel-Sea-8GB-128GB-Storage/dp/B0CMHLNVGS/ref=sr_1_3?crid=15JYE7A72BD2R&keywords=google+pixel&qid=1700846833&sprefix=google+pixel%2Caps%2C187&sr=8-3
above two url are for the same product, but because user visited this page using different search keywords, the url formed is slightly different. because of this, when user tracks again, a different track request is created, which it should not.
one solution: strip the use to remove the extra information before storing in our database. for example only store the below as url.
https://www.amazon.in/Pixel-Sea-8GB-128GB-Storage/dp/B0CMHLNVGS/
example: if scraping fails, use the supported api function to get the data.
might need changes to product-scrape repo(like returning multiple functions instead of only scraping function). need to think and come up with the design, and implementation.
scrape()
function that we have?fmt.Print*
and replace with log
packagemanifest.json:
right now, it is not clear from the chrome extension icon if it is local deployment or installation from chrome web store. we need to have a different logo for local installation of chrome extension.
PT
add git commit info in logs:
send a rich html email instead of plain text
it will be valuable to know this information to plan supporting new websites based on the demand.
changes:
when the track request validation error is websiteNotSupported
, before returning with status code StatusNotAcceptable
, we should save the hostname in a new table. this table should have the unsupported host and the timestamp of the request. later we can use this information to count the number of requests coming for each of those unsupported websites and then plan tto support the recent ones in high demand.
we should also update the chrome extension to send better message (on StatusNotAcceptable
status code is received) to hint the user, that we know that the user wants to track product from that host and we will try to include support for it.
design: TBD
user authentication
add user id to track request ids
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.