1.6.4 • Published 2 years ago
google-it v1.6.4
google-it
A simple library to convert Google search results to JSON output, with an interactive display option coming in the near future.
Install
$ npm install --save -g google-it
Example Usage
$ google-it --query="Latvian unicorn"
Prevent display in the terminal, and save results to a JSON file:
$ google-it --query="PWAs with react-router and redux" -o results.json -n
$ google-it --query="open whisper systems" -O 5
$ google-it --query="mechanical turk" --only-urls
Command Line Arguments
- query - the query that should be sent to the Google search
- output - name of the JSON file to save results to
- no-display - prevent results from appearing in the terminal output. Should only be used with --output (-o) command when saving results to a file
- save - name of the html file if you want to save the actual response from the html request (useful for debugging purposes)
- limit - number of search results to be returned
- only-urls - only display the URLs, instead of the titles and snippets
- verbose - console.log useful statements to show what's currently taking place
- interactive - once results are returned, show them in an interactive prompt where user can scroll through them
- bold-matching-text - only takes effect when interactive (-i) flag is set as well, will bold test in results that matched the query
- includeSites - option to limit results to comma-separated list of sites
- excludeSites - option to exclude results that appear in comma-separated list of sites
- open - opens the first X number of results in the browser after finishing query
- disableConsole - intended to be used with programmatic use, so that the color-coded search results are not displayed in the terminal (via console.log) when not wanted.
Programmatic Use in NodeJS environment
- something like:
const googleIt = require('google-it')
googleIt({'query': 'covfefe irony'}).then(results => {
// access to results object here
}).catch(e => {
// any possible errors that might have occurred (like no Internet connection)
})
// with request options
const options = {
'proxy': 'http://localhost:8118'
};
googleIt({options, 'query': 'covfefe irony'}).then(results => {
// access to results object here
}).catch(e => {
// any possible errors that might have occurred (like no Internet connection)
})
1.6.4
2 years ago
1.6.3
2 years ago
1.6.2
4 years ago
1.6.1
4 years ago
1.6.0
4 years ago
1.5.4
4 years ago
1.5.3
4 years ago
1.5.2
4 years ago
1.5.1
4 years ago
1.5.0
5 years ago
1.4.3
5 years ago
1.4.2
5 years ago
1.4.1
5 years ago
1.4.0
5 years ago
1.3.0
5 years ago
1.2.2
5 years ago
1.2.1
5 years ago
1.2.0
5 years ago
1.1.3
6 years ago
1.1.2
6 years ago
1.1.1
7 years ago
1.1.0
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago