Added vin to pass back to registry

master
Edward Peterson 3 years ago
parent ce8c48e9ec
commit 1e817add3a

@ -2,9 +2,8 @@ const puppeteer = require('puppeteer');
const genericVinParserFactory = require('../processors/generics/generic-vin-parser'); const genericVinParserFactory = require('../processors/generics/generic-vin-parser');
const superagent = require('superagent'); const superagent = require('superagent');
module.exports = { module.exports = {
cronString: '0 22 * * *', cronString: '15 23 * * *',
run: async function () { run: async function () {
return;
const startingPoint = 'https://topclassiccarsforsale.com/amc'; const startingPoint = 'https://topclassiccarsforsale.com/amc';
const browser = await puppeteer.launch({ const browser = await puppeteer.launch({
headless: true headless: true
@ -30,7 +29,8 @@ module.exports = {
cars.forEach(car => { cars.forEach(car => {
superagent.post('http://localhost:3000/lead/createFromCrawler') superagent.post('http://localhost:3000/lead/createFromCrawler')
.send({ .send({
url: car.url url: car.url,
vinNumber: car.vin
}) })
.set('authorization', `Basic ${process.env.crawlerToken}`) .set('authorization', `Basic ${process.env.crawlerToken}`)
.end((err, res) => { .end((err, res) => {

Loading…
Cancel
Save