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
19 changes: 19 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#514389",
"activityBar.activeBorder": "#2b1915",
"activityBar.background": "#514389",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#2b1915",
"activityBarBadge.foreground": "#e7e7e7",
"statusBar.background": "#3d3267",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#514389",
"titleBar.activeBackground": "#3d3267",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#3d326799",
"titleBar.inactiveForeground": "#e7e7e799"
},
"peacock.color": "#3d3267"
}
Empty file modified bin/cli.js
100644 → 100755
Empty file.
13 changes: 12 additions & 1 deletion lib/Amazon.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// @ts-nocheck
fs = require('fs');
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is wrong

const rp = require('request-promise');
const { forEachLimit } = require('async');
const { writeFile } = require('fs');
Expand Down Expand Up @@ -1096,7 +1097,17 @@ class AmazonScraper {
? $($(`span.reviewCountTextLinkedHistogram.noUnderline`)[0]).text().split(/\s/g)[0]
: 0;

output.price.current_price = $(`#priceblock_ourprice`)[0] ? this.geo.price_format($($(`#priceblock_ourprice`)[0].children[0]).text()) : 0;
var _price = 0;
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let instead of var will be better

const _price_tags = ['#priceblock_ourprice', '#priceblock_saleprice', '#priceblock_dealprice', '#newBuyBoxPrice', '#price'];
for (var i in _price_tags) {
const _priceTag = _price_tags[i];
if ($(`${_priceTag}`)[0]) {
_price = this.geo.price_format($($(`${_priceTag}`)[0].children[0]).text());
break;
}
}

output.price.current_price = _price;

output.product_information.store_id = $(`input[id="storeID"]`).val();
output.product_information.brand = $(`a[id="bylineInfo"]`).text() || '';
Expand Down
Loading