GithubHelp home page GithubHelp logo

muly / product-track Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 0.0 484 KB

online product price and availability tracking

License: MIT License

Go 59.46% Makefile 1.08% CSS 3.01% HTML 20.67% JavaScript 8.53% Shell 3.99% Gherkin 3.25%

product-track's People

Contributors

muly avatar rohithknaidu avatar

Watchers

 avatar  avatar

product-track's Issues

integration tests failing

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

google chrome extension

when user click the extension, a popup should be shown with below options

  • track availability
  • track price (with a text box for min price threshold)

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

integration testing

using cucumber/karate tests

  • add support for service mock web pages
  • mock web pages: amazon product web page for available product (price and quantity)
  • mock web pages: amazon product web page for unavailable product
  • mock web pages: flipkart product web page for available product
  • mock web pages: flipkart product web page for unavailable product
  • integration testing framework: simple feature file with support to run test from go test
  • improve integration testing in Data Driven Testing format
  • update feature data table to cover the below scenarios:
  • - amazon available product: verify the price and availability
  • - amazon unavailable product: verify the unavailability
  • - flipcart available product: verify the price and availability
  • - flipcart unavailable product: verify the unavailability
  • - unsupported website

chromestore submission rejected: ’Invalid value for ‘oauth2.client_id’

Version: 1.1.1
Status: Rejection
Violation date: Dec 21, 2023

Violation type: Spam and Placement in the Store
Details:

  • Violation reference ID: Yellow Magnesium
  • Violation: Not providing promised functionality
    • ’Invalid value for ‘oauth2.client_id’
  • How to rectify: Test the code that you submit to the web store locally, verify that your submission contains the files you expect at the paths you expect, and is working as intended. For more information, please refer to the documentation and migration checklist on Manifest V3 version.
  • Relevant section of the program policy: Extensions with broken functionality - such as dead sites or non-functioning features - are not allowed.

convert the project into an api

Acceptance criteria

  • able to run the api local and test using postman or curl
  • user endpoints:
    • [POST] availability track request from user /track/availability
    • [POST] price track request from user /track/price
  • internal endpoints:
    • [POST] availability and price of a product /product

[POST] /track/availability:
input:

  • url string

output: http status only

[POST] /track/price
input:

  • url string
  • min threshold price float

output: http status only

[POST] /product
input:

  • url string

output:

  • url
  • price
  • availability

router library: julienschmidt/httprouter

refine privacy_policy

some pointers:

  • how user data is collection:
  • what is done with the user data collected:
  • any trackers (like cookies) are used? No
  • any ad networks used? No
  • how to opt in to this data collection? by installing this chrome extension
  • how to opt out of this data collection? ?????
  • how user can request to delete their data or download their data?
  • contact information for app owner?

rephrase doesn't support message

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

send email notification

design: TBD

design questions:
to which email address the notification to be sent?
where to save this email address in the database?

duplicate track request for the same product by the same user

scenario:

  1. user searches for google pixel and select the google pixel 7a 5g and request the track request.
    2, and later same user searches for 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/

support 10 more e-commerce websites

  • find next 10 popular ecommerce websites
  • inspect and find the tags for scraping logic
  • are these websites fitting in the template of the generic scrape() function that we have?
  • save the scrape tags metadata into a private website
  • modify the code to import this website to scrape.

cleanup

  • move the unit test functions into separate test files. ex functions from units.go should have the unit tests in utils_test.go
  • remove fmt.Print* and replace with log package
  • add make file: build, test

different logo image for local deployment of the chrome extension

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.

  • new logo with simple text such as PT
  • make file and script update to use the new logo file when preparing for the chrome local deployment.

git commit info in logs

add git commit info in logs:

  • latest commit hash
  • if there are any uncommitted changes at the time of deployment: yes/no

record the websites that user is trying to use the product tracker other than the websites we are supporting

it will be valuable to know this information to plan supporting new websites based on the demand.

changes:

  1. 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.

  2. 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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.