0.2.0 • Published 7 years ago

nightmare-helper v0.2.0

Weekly downloads
1
License
ISC
Repository
github
Last release
7 years ago

nightmare-helper

Google image search with Nightmare.js

Default options

{
  filters:"&tbs=ic:color,itp:photo,isz:lt,islt:svga&tbm=isch",

  location:"bg",

  show:false,

  horizontalFlag:true
}

Filters

Filter string which append to the search query.

The default string will request color photos larger than 800x600 px

Location

Your local Google domain ending

Show

Whether to show the scraping process or to stay hidden

Horizontal flag

Returns only images which has larger width than height. If false, it will return all images

Methods

  • googleImages - return instant results
  • googleImagesLong - returns result after 500ms, so it can scroll down and fetch more images

Example use

const nightmareHelper = require("nightmare-helper")

nightmareHelper.googleImages("Ayn Rand")
.then(console.log)
.catch(console.log)

Output

[{ height: 1365,
  imageSrc: 'http://www.theimaginativeconservative.org/wp-content/uploads/2014/09/Burke_Statue_Closeup_by_Steven_Christe.jpg',
  thumbSrc: 'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTT3hTT2wWk_dRzTYSJS3PUWKvGyWBtqMW8SvhBH5cMEpipvVra',
  width: 2048 },
{ height: 1065,
  imageSrc: 'https://tstoaddicts.files.wordpress.com/2016/01/ms-sinclair-ayn-rand-school-for-tots-simpsons.jpg',
  thumbSrc: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQomkbD7VvIPgQJLwPI9p4NwvsfseHrdRG-d9LBwNOLvViTOppNjQ',
  width: 1486 },
{ height: 1100,
  imageSrc: 'http://geo.blog.bg/photos/7/original/Ain-Rand-Kapitalismat-Nepoznatiqt-Ideal.png',
  thumbSrc: 'https://encrypted-tbn1.gstatic.com/images?q=tbn:ANd9GcTZ5_DvOBfwskswRPdf-IEHmvLr-ZI9BFonofpfistC35K07cfl_Q',
  width: 600 } ]

Note

Nightmare depends on Electron so you can use this library, only if your OS is compatible with Electron.

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago