Socket
Socket
Sign inDemoInstall

aliexscrape

Package Overview
Dependencies
66
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.6 to 1.0.7

29

index.js

@@ -24,5 +24,4 @@ const rp = require('request-promise');

optionId: `${$(child).find('ul').attr('data-sku-prop-id')}:${$(li).find('a').attr('data-sku-id')}`,
src: optionTag.attribs.src,
src: optionTag.attribs.src.replace(/.jpg(.*).jpg/, '.jpg'),
text: optionTag.attribs.title,
bigpic: optionTag.attribs.bigpic,
});

@@ -38,2 +37,7 @@ } else if (optionTag.name === 'span') {

});
// seller/store data
data.store = {
name: $(response).find('span.shop-name').find('a').text(),
id: $(response).find('span.shop-name').find('a').attr('href').match(/(\d+)/)[0],
}
// pics

@@ -44,16 +48,15 @@ data.pics = [];

})
// pricing
data.pricing = [];
const pricingJSON = /var.skuProducts=(.*);/.exec(response)[1];
const rawPricing = JSON.parse(pricingJSON);
rawPricing.map(pricing => {
// variations
data.variations = [];
const variationsJSON = /var.skuProducts=(.*);/.exec(response)[1];
const rawVariations = JSON.parse(variationsJSON);
rawVariations.map(variation => {
const pricingData = {
singlePricing: pricing.skuVal.actSkuCalPrice || pricing.skuVal.skuCalPrice,
bulkPricing: pricing.skuVal.actSkuBulkCalPrice,
bulkOrder: pricing.skuVal.bulkOrder,
pricing: variation.skuVal.skuCalPrice,
discount: variation.skuVal.actSkuCalPrice,
}
if (pricing.skuAttr) {
pricingData.combinedAttributes = pricing.skuAttr.match(/[0-9]{1,20}:[0-9]{1,20}/g);
if (variation.skuAttr) {
pricingData.combinedAttributes = variation.skuAttr.match(/[0-9]{1,20}:[0-9]{1,20}/g);
}
data.pricing.push(pricingData);
data.variations.push(pricingData);
})

@@ -60,0 +63,0 @@ // freight, get real-time here => https://freight.aliexpress.com/ajaxFreightCalculateService.htm?productid=32830803458&count=1&currencyCode=USD&country=TH

{
"name": "aliexscrape",
"version": "1.0.6",
"version": "1.0.7",
"description": "Get Aliexpress product details in JSON",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc