Added coin.org - A description of the project
This commit is contained in:
17
coin.org
Normal file
17
coin.org
Normal 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
4
upc.py
@ -7,6 +7,9 @@ driver.implicitly_wait(5)
|
|||||||
def get_name_from_upc(upc: str) -> str:
|
def get_name_from_upc(upc: str) -> str:
|
||||||
url = "https://stocktrack.ca/wm/index.php?s=wm&upc=" + upc
|
url = "https://stocktrack.ca/wm/index.php?s=wm&upc=" + upc
|
||||||
driver.get(url)
|
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({
|
driver.add_cookie({
|
||||||
"name": "PHPSESSID",
|
"name": "PHPSESSID",
|
||||||
"value": "835ttgvbgncf4uq82dpagmk688",
|
"value": "835ttgvbgncf4uq82dpagmk688",
|
||||||
@ -25,6 +28,7 @@ def get_name_from_upc(upc: str) -> str:
|
|||||||
"path": "/",
|
"path": "/",
|
||||||
"domain": "stocktrack.ca"
|
"domain": "stocktrack.ca"
|
||||||
})
|
})
|
||||||
|
|
||||||
driver.refresh()
|
driver.refresh()
|
||||||
name = ""
|
name = ""
|
||||||
str_s = "target=\"_blank\">"
|
str_s = "target=\"_blank\">"
|
||||||
|
Reference in New Issue
Block a user