-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
390 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,5 @@ | ||
import { Shopee } from "./shopee.js"; | ||
import { ShopeeFlashSale } from "./shopee_flashsale.js"; | ||
import { getShopeeProductDetail } from "./shopee_product.js" | ||
import { Zalora } from "./zalora.js"; | ||
// import * as fs from 'fs'; | ||
import * as shopee from './shopee.js'; | ||
|
||
/** | ||
* Shopee fashion muslim | ||
* | ||
*/ | ||
const getShopeeFlashSaleFashionMuslim = async() => { | ||
// look into flash sale promotion list | ||
const promotionData = await ShopeeFlashSale.getPromotion(); | ||
const session = 0; // 0 is current flash sale session | ||
const activePromo = await promotionData[session]; | ||
console.info("Retrieve data %s", activePromo.name); | ||
const itemList = await ShopeeFlashSale.getItem(activePromo.url, 34); | ||
// 34 is fashion muslim category, look at ShopeeFlashSale.getCategory(0) for more | ||
const productList = await ShopeeFlashSale.getFlashSale(activePromo.promotionid, itemList); | ||
console.info("Item count: %s", productList.length); | ||
return productList; | ||
} | ||
var fashionMuslim = await getShopeeFlashSaleFashionMuslim(); | ||
console.log(fashionMuslim); | ||
// console.log(await Shopee.getCategory()); | ||
|
||
/** | ||
* Product detail | ||
* | ||
*/ | ||
var url = "https://shopee.co.id/GFS-3412-CELANA-KULOT-CRINCLE-PREMIUM-ANTI-KUSUT-2-i.5825746.22420129082?sp_atk=6e0215e0-ea30-4373-9cc6-19c6a799abdb&xptdk=6e0215e0-ea30-4373-9cc6-19c6a799abdb"; | ||
var productDetail = await getShopeeProductDetail(url); | ||
console.log(productDetail); | ||
|
||
|
||
/** | ||
* Zalora | ||
* | ||
*/ | ||
var url = "https://www.zalora.co.id/women/pakaian/rok/" | ||
var data = await Zalora.getProduct(url, 1); | ||
if (!data.error) { | ||
data.forEach((item, i) => { console.log("%s: %s <%s>", i+1, item.name, item.link); }); | ||
// console.log(data[0]); | ||
} else { | ||
console.log(data); | ||
}; | ||
var url = 'https://shopee.co.id/Audio-Technica-ATH-M20xBT-Wireless-Over-Ear-Headphones-i.5696604.15949131744'; | ||
var product_detail = await shopee.get_shopee_product_detail(url); | ||
console.log(product_detail); |
Oops, something went wrong.