Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -913,6 +913,11 @@ const options = {
currency: 'EUR',
host: 'www.amazon.es',
},
EG: {
country: 'Egypt',
currency: 'EGP',
host: 'www.amazon.eg',
},
TR: {
country: 'Turkey',
currency: 'TRY',
Expand Down
56 changes: 56 additions & 0 deletions lib/constant.js
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,62 @@ module.exports = {
},
},
},
EG: {
country: 'Egypt',
currency: 'EGP',
host: 'www.amazon.eg',
symbol: 'ج.م',
variants: {
split_text: 'Click to select ',
},
best_seller: (text) => {
if (text) {
const match = text.match(/(#[\d,|]+) in[\s\n ]([\w&'\s]+)/);
if (match) {
return { rank: parseInt(match[1].replace(/[^\d]/g, '')), category: match[2].trim() };
}
}
return '';
},
review_date: (date) => {
const dateRegex = /on (.+)$/.exec(date);
if (dateRegex) {
return {
date: dateRegex[1],
unix: moment(new Date(`${dateRegex[1]} 02:00:00`))
.utc()
.unix(),
};
}
return '';
},
price_format: (price) => {
const formatedPrice = price.replace(/[^\d+\.]/g, '');
return parseFloat(formatedPrice);
},
product_information: {
id: [
'#detailBullets_feature_div > ul',
'#productDetails_detailBullets_sections1',
'#productDetails_techSpec_section_1',
'#productDetails_techSpec_section_2',
'#detailBulletsWrapper_feature_div > ul:nth-child(5)',
],
fields: {
'Amazon Best Sellers Rank': { key: '', rank: true },
'Best-sellers rank': { key: '', rank: true },
'Best Sellers Rank': { key: '', rank: true },
'Package Dimensions': { key: 'dimensions' },
'Product Dimensions': { key: 'dimensions' },
'Parcel Dimensions': { key: 'dimensions' },
'Item Weight': { key: 'weight' },
Manufacturer: { key: 'manufacturer' },
'Release date': { key: 'available_from' },
'Date First Available': { key: 'available_from' },
'Item model number': { key: 'model_number' },
},
},
},
TR: {
country: 'Turkey',
currency: 'TRY',
Expand Down