Scraper

node v6.17.1
version: 1.0.0
endpointsharetweet
const GoogleScraper = require('google-scraper'); const express = require("express"); var app = express; var searchScrape = function(req,res,next) { const options = { keyword: req.params.term, language: req.params.lang, tld:"com", results: req.params.resultsnum }; const scrape = new GoogleScraper(options); scrape.getGoogleLinks.then(function(value) { global.searchValue = value; console.log(value); }).catch(function(e) { console.log(e); }) res.end(global.searchValue); } app.get('/s/:lang/:term/:resultsnum',searchScrape);
Loading…

no comments

    sign in to comment