Ecommerce Logistics
by @charles-lpf
Aggregate logistics information from Taobao, JD, PDD, and Douyin. One-click query for multi-platform order tracking. Supports persistent cookie storage and Q...
clawhub install ecommerce-logistics๐ About This Skill
name: ecommerce-logistics description: "Aggregate logistics information from Taobao, JD, PDD, and Douyin. One-click query for multi-platform order tracking. Supports persistent cookie storage and QR code login. Use when user asks to check orders, track packages from shopping platforms, or mentions ๆทๅฎ/ไบฌไธ/ๆผๅคๅค/ๆ้ณ ็ฉๆต/่ฎขๅ."
E-commerce Logistics Aggregator๏ผ็ตๅ็ฉๆต่ๅ๏ผ
Query order logistics from Taobao, JD.com, Pinduoduo, and Douyin with persistent authentication.
Features
Setup
# Install dependencies
cd scripts && npm installRequired environment variables (optional, for headless operation)
export ECOM_LOGISTICS_DATA_DIR="$HOME/.ecommerce-logistics"
Usage
First Time: Login to Platforms
cd scriptsLogin to Taobao (opens browser for QR scan)
npm run query -- --platform taobao --loginLogin to PDD
npm run query -- --platform pdd --loginNote: JD and Douyin are not supported due to strict anti-bot measures
Query Logistics
# Query all platforms (requires prior login)
npm run query -- --allQuery specific platform
npm run query -- --platform taobao
npm run query -- --platform pddQuery with custom data directory
npm run query -- --all --data-dir /path/to/cookiesRun in headless mode (no browser window)
npm run query -- --all --headless
QR Login Process
When cookies are missing or expired:
1. The skill opens a browser window with the platform login page
2. A QR code screenshot is saved to ~/.ecommerce-logistics/{platform}-qr.png
3. Scan the QR code with the platform's mobile app
4. Complete login in the browser window
5. Cookies are automatically saved for future use
Note: If you see "Cookie ๅทฒ่ฟๆ๏ผ้่ฆ้ๆฐ็ปๅฝ", run the login command again.
Cookie Storage
Cookies are stored encrypted in:
~/.ecommerce-logistics/cookies/Architecture
scripts/src/
โโโ index.ts # CLI entry
โโโ core/
โ โโโ aggregator.ts # Main orchestrator
โ โโโ auth-manager.ts # Cookie & QR login
โ โโโ rate-limiter.ts # Request throttling
โ โโโ stealth-browser.ts # Anti-detection browser
โโโ adapters/
โ โโโ base-adapter.ts # Abstract base class
โ โโโ taobao-adapter.ts
โ โโโ jd-adapter.ts
โ โโโ pdd-adapter.ts
โ โโโ douyin-adapter.ts
โโโ types/
โโโ index.ts # TypeScript interfacesreferences/
โโโ selectors.md # Platform-specific CSS selectors
Error Handling
| Error | Handling | |-------|----------| | Cookie expired | Prompt QR re-login | | Rate limited | Auto-backoff retry | | Login page detected | Graceful error with instructions | | Network timeout | 3 retries with exponential backoff |
Platform Support Status
| Platform | Status | Notes | |----------|--------|-------| | Taobao | โ Available | Order list + logistics info | | JD | โ Unsupported | Anti-bot detection too strict | | PDD | โ Available | Order list + tracking number + pickup code | | Douyin | โ Unsupported | Requires mobile app access |
Implementation Notes
Anti-Detection Measures
The skill implements several stealth techniques:
1. navigator.webdriver override - Hides automation flag
2. Plugins spoofing - Simulates real browser plugins
3. Viewport & User-Agent - Uses realistic desktop/mobile profiles
4. Permissions API - Overrides notification permissions
5. Playwright-specific cleanup - Removes __playwright properties
Rate Limiting
Each platform has independent rate limits:
| Platform | Max Requests | Window | |----------|-------------|--------| | Taobao | 10 | 60s | | JD | 15 | 60s | | PDD | 8 | 60s | | Douyin | 10 | 60s |
Cookie Expiration
Development
Updating Selectors
Platform websites change frequently. Update selectors in:
references/selectors.md - Documentationsrc/adapters/*-adapter.ts - ImplementationTesting
# Compile TypeScript
cd scripts && npm run buildRun in development mode
npm run dev -- --platform taobaoDebug with visible browser
npm run query -- --platform taobao --headless=false
๐ก Examples
First Time: Login to Platforms
cd scriptsLogin to Taobao (opens browser for QR scan)
npm run query -- --platform taobao --loginLogin to PDD
npm run query -- --platform pdd --loginNote: JD and Douyin are not supported due to strict anti-bot measures
Query Logistics
# Query all platforms (requires prior login)
npm run query -- --allQuery specific platform
npm run query -- --platform taobao
npm run query -- --platform pddQuery with custom data directory
npm run query -- --all --data-dir /path/to/cookiesRun in headless mode (no browser window)
npm run query -- --all --headless
QR Login Process
When cookies are missing or expired:
1. The skill opens a browser window with the platform login page
2. A QR code screenshot is saved to ~/.ecommerce-logistics/{platform}-qr.png
3. Scan the QR code with the platform's mobile app
4. Complete login in the browser window
5. Cookies are automatically saved for future use
Note: If you see "Cookie ๅทฒ่ฟๆ๏ผ้่ฆ้ๆฐ็ปๅฝ", run the login command again.
โ๏ธ Configuration
# Install dependencies
cd scripts && npm installRequired environment variables (optional, for headless operation)
export ECOM_LOGISTICS_DATA_DIR="$HOME/.ecommerce-logistics"