Socket
Socket
Sign inDemoInstall

google-sr

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-sr - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

15

index.js

@@ -7,5 +7,5 @@ const cheerio = require('cheerio')

const DescriptionSelector = '#main > div > div > div > div:not(.v9i61e) > div.AP7Wnd'
const linkSelector = 'div.ZINbbc > div:nth-child(1) > a'
const TitleSelector = 'div.ZINbbc > div:nth-child(1) > a > h3'
let DescriptionSelector = '#main > div > div > div > div:not(.v9i61e) > div.AP7Wnd'
let linkSelector = 'div.ZINbbc > div:nth-child(1) > a'
let TitleSelector = 'div.ZINbbc > div:nth-child(1) > a > h3'

@@ -17,5 +17,11 @@

query: query,
safeMode: options.safe ? options.safe !== 'active' ? false : 'active' : options.safe !== false ? 'active' : 'false'
safeMode: options.safe ? options.safe !== 'active' ? false : 'active' : options.safe !== false ? 'active' : 'false',
page: options.page ? options.page : false
}
let URL = PrepareUrl(Poptions)
if(options.selectors){
if(options.selectors.linkSelector) linkSelector = options.selectors.linkSelector
if(options.selectors.DescriptionSelector) DescriptionSelector = options.selectors.DescriptionSelector
if(options.selectors.TitleSelector) linkSelector = options.selectors.TitleSelector
}
const resp = await fetch(URL).then(r => r.text())

@@ -27,3 +33,2 @@ const $ = cheerio.load(resp);

raw: resp,
}

@@ -30,0 +35,0 @@

{
"name": "google-sr",
"version": "1.0.2",
"version": "1.0.3",
"description": "Yet another library to do google a search, easy and simple",

@@ -5,0 +5,0 @@ "repository": "typicalninja493/google-sr",

@@ -37,4 +37,17 @@ ## Google-sr

### Available options
* Page - default:- **1**
* Selectors - `DescriptionSelector`, `linkSelector`, `TitleSelector`
* safe - default:- `true`
selectors default -
* DescriptionSelector - `#main > div > div > div > div:not(.v9i61e) > div.AP7Wnd`
* linkSelector - `div.ZINbbc > div:nth-child(1) > a`
* TitleSelector - `div.ZINbbc > div:nth-child(1) > a > h3`
* selectors **MUST** be in the object options.selectors
ex- options.selectors.DescriptionSelector = 'some-selector'
# Support
Join my discord server for support: [discord](https://discord.gg/9s52pz6nWX)

@@ -18,3 +18,4 @@ const querystring = require('querystring')

}
if(options.safeMode == 'active') optionsForQueryString.safe = 'active'
if(options.safeMode == 'active') optionsForQueryString.safe = 'active';
if(options.page !== false) optionsForQueryString.start = options.page;

@@ -21,0 +22,0 @@ const url = URL + '?' + querystring.stringify(optionsForQueryString)

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc