Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
google-img.js
Advanced tools
Readme
Search images using Google Custom Search Engine API.
This is a recreation of a npm, I recreated it because the original npm had some vulnerabilities
Original package created by Vadim Demedes
$ npm install --save google-img.js
Note: You'll need to set up your own Google Custom Search Engine to execute queries.
const {Client} = require('google-img.js');
const google = new Client('CSE ID', 'API KEY');
google.search('Steve Angello')
.then(images => {
/*
[{
"url": "http://steveangello.com/boss.jpg",
"type": "image/jpeg",
"width": 1024,
"height": 768,
"size": 102451,
"thumbnail": {
"url": "http://steveangello.com/thumbnail.jpg",
"width": 512,
"height": 512
}
}]
*/
});
// safe search (Off by default)
google.search('Steve Angello', {safe: 'active'})
// paginate results
google.search('Steve Angello', {page: 2});
// search for certain size
google.search('Steve Angello', {size: 'large'});
// search specific image type
google.search('Steve Angello', {type: 'face'})
// search specific dominant color
google.search('Steve Angello', {dominantColor: 'black'})
// search specific color type like transparent
google.search('Steve Angello', {colorType: 'trans'})
// when searching with multiple options, remember to separate each option with a comma
google.search('Steve Angello', {safe: 'active', dominantColor: 'blue'})
Please see Google's API documentation for details on the option and response properties and their possible values. Note that the option names used here may differ slightly (e.g. no img
prefix).
Type: string
The identifier for a Custom Search Engine to use.
Type: string
The credentials for accessing Google's API.
Perform an image search for query
.
Type: string
The search terms to use for finding images. Identical to those you would use in a web search.
Type: object
Type: number
Default: 1
The range of results to return. Useful because often results cannot be returned in a single response. Note that it is a one-based unsigned integer. E.g. page 1
has the first 10 results, page 2
has the next set of 10, etc.
Type: string
The size of images to search. E.g. medium
or xxlarge
.
Type: string
The category of images to search. E.g. face
or photo
.
Type: string
The dominant color to search for. E.g. yellow
or purple
.
Type: string
The category of color spectrums to search. E.g. gray
or color
.
Type: string
The heuristic level to use for filtering out explicit content using SafeSearch. E.g. off
or high
.
Google deprecated their public Google Images API, so to search for images you need to sign up for Google Custom Search Engine. Here are the steps you need to do:
You can do this here: https://cse.google.com/cse.
Do not specify any sites to search but instead use the "Restrict Pages using Schema.org Types" under the "Advanced options".
For the most inclusive set, use the Schema: Thing
. Make a note of the CSE ID.
In your search engine settings, enable "Image search":
Register a new app and enable Google Custom Search Engine API here: Google Developers Console. Make a note of the API key.
MIT © Mendo6472
FAQs
Search images using Google Custom Search Engine API
The npm package google-img.js receives a total of 0 weekly downloads. As such, google-img.js popularity was classified as not popular.
We found that google-img.js demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.