[+] Usage guide

This commit is contained in:
Azalea Gui
2023-02-04 02:37:52 -05:00
parent 512e438ca0
commit b4c0f8d259
3 changed files with 21 additions and 2 deletions
+19
View File
@@ -1,3 +1,22 @@
# Superbuy
Automatically add Taobao orders to Superbuy
## Usage Guide
### Installation
1. Clone/download this repo
2. Install Tampermonkey on your default browser
3. Create a new userscript, copy-and-paste the content of `taobao.js`
4. Install python>=3.9 (tested on 3.11)
5. `pip install -r requirements.txt`
6. Fill in your email and password in `auth.toml`
### Usage
1. Login to taobao
2. `python mobile.py` will open a browser tab and close it after it syncs all orders
Note: If you have manually-added orders before using this script, you can change the `MIN_DATE` variable in `mobile.py` to the date of the first order you want to sync.
+2 -2
View File
@@ -25,7 +25,7 @@ r.headers.update({
'app-key': 'aaa',
})
MIN_DATE = '2023-01-01'
CONFIG_PATH = Path('.config/superbuy')
@@ -114,7 +114,7 @@ def create_diy_order(create: list[TaobaoOrder]):
"""
orders = gateway_order_list()
ids = [get_url_param(i.GoodsLink, 'id') for o in orders for i in o.Items if 'id=' in i.GoodsLink]
create = [o for o in create if o.date >= '2023-01-01' and not any(get_url_param(i.url, 'id') in ids for i in o.items)]
create = [o for o in create if o.date >= MIN_DATE and not any(get_url_param(i.url, 'id') in ids for i in o.items)]
for c in create:
shop_name = c.store.name
shop_id = crawl(c.items[0].url)['data']['shop']['shopId']