Added coin.org - A description of the project

This commit is contained in:
2024-02-23 23:36:52 -05:00
parent 498afc6995
commit 3f22a0373f
2 changed files with 21 additions and 0 deletions

17
coin.org Normal file
View File

@ -0,0 +1,17 @@
#+TITLE: coin - An inventory manager to keep track of items bought from Walmart (Canada)
#+AUTHOR: Peisong Xiao
#+EMAIL: peisong.xiao.xps@gmail.com
#+OPTIONS: toc:nil date:nil
* Why coin?
If you'd like to keep track of your groceries, use coin.
* How does coin work?
First, coins pulls the UPC and price info off of the given Walmart
receipt.
Then, coin matches the name with the UPC (Yes! No more scratching your
head against seemingly random Walmart abbreviations for items!) using
a scraper
Finally, it stores your shopping trip in a database.

4
upc.py
View File

@ -7,6 +7,9 @@ driver.implicitly_wait(5)
def get_name_from_upc(upc: str) -> str:
url = "https://stocktrack.ca/wm/index.php?s=wm&upc=" + upc
driver.get(url)
# Change the cookies here to match that of yours when you lookup
# any item on stocktrack.ca to bypass the Cloudflare checks
driver.add_cookie({
"name": "PHPSESSID",
"value": "835ttgvbgncf4uq82dpagmk688",
@ -25,6 +28,7 @@ def get_name_from_upc(upc: str) -> str:
"path": "/",
"domain": "stocktrack.ca"
})
driver.refresh()
name = ""
str_s = "target=\"_blank\">"