[+] Usage guide
This commit is contained in:
@@ -1,3 +1,22 @@
|
|||||||
# Superbuy
|
# Superbuy
|
||||||
|
|
||||||
Automatically add Taobao orders to 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.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ r.headers.update({
|
|||||||
'app-key': 'aaa',
|
'app-key': 'aaa',
|
||||||
})
|
})
|
||||||
|
|
||||||
|
MIN_DATE = '2023-01-01'
|
||||||
CONFIG_PATH = Path('.config/superbuy')
|
CONFIG_PATH = Path('.config/superbuy')
|
||||||
|
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ def create_diy_order(create: list[TaobaoOrder]):
|
|||||||
"""
|
"""
|
||||||
orders = gateway_order_list()
|
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]
|
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:
|
for c in create:
|
||||||
shop_name = c.store.name
|
shop_name = c.store.name
|
||||||
shop_id = crawl(c.items[0].url)['data']['shop']['shopId']
|
shop_id = crawl(c.items[0].url)['data']['shop']['shopId']
|
||||||
|
|||||||
Reference in New Issue
Block a user