# hubot-google-images

> A hubot script that interacts with the Google Images API.

Latest version **0.2.7** (published 2017-06-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install hubot-google-images
pnpm add hubot-google-images
yarn add hubot-google-images
bun add hubot-google-images
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.7 |
| Published | 2017-06-27 |
| First published | 2014-08-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Josh Nichols |
| Maintainers | hubotbot, haroldputman, louim, michaelansel, technicalpickles |
| Keywords | hubot, hubot-scripts |

## Links

- npm: https://www.npmjs.com/package/hubot-google-images
- Repository: https://github.com/hubot-scripts/hubot-google-images
- Homepage: https://github.com/hubot-scripts/hubot-google-images#readme
- Issues: https://github.com/hubot-scripts/hubot-google-images/issues
- npm.io page: https://npm.io/package/hubot-google-images

## Recent versions

- 0.2.7 (latest) — 2017-06-27
- 0.2.6 — 2015-12-07
- 0.2.5 — 2015-11-26
- 0.2.4 — 2015-11-17
- 0.2.3 — 2015-11-01
- 0.2.2 — 2015-09-26
- 0.2.1 — 2015-08-19
- 0.1.5 — 2015-06-06
- 0.2.0 — 2015-06-06
- 0.1.4 — 2015-03-06
- 0.1.3 — 2015-02-11
- 0.1.2 — 2014-12-15
- 0.1.1 — 2014-11-25
- 0.1.0 — 2014-08-25

## README

# hubot-google-images

A hubot script that interacts with the Google Custom Search API for greater
productivity and lulz.

See [`src/google-images.coffee`](src/google-images.coffee) for full documentation.

## Installation

In hubot project repo, run:

`npm install hubot-google-images --save`

Then add **hubot-google-images** to your `external-scripts.json`:

```json
[
  "hubot-google-images"
]
```

## Configuration

### Custom Search Engine
Google no longer offers an unregistered image search API. You must set up a
[Google Custom Search API](https://developers.google.com/custom-search/docs/overview) and set
the environment variables `HUBOT_GOOGLE_CSE_ID` and `HUBOT_GOOGLE_CSE_KEY`.

The Custom Search API provides up to [100 search queries per day](https://developers.google.com/custom-search/json-api/v1/overview) for free.
If you need more than that you'll have to pay.

#### CSE setup details
1. Create a CSE via these [instructions](https://developers.google.com/custom-search/docs/tutorial/creatingcse).
  - To simulate the old behavior:  select "Search the entire web but emphasize included sites" in 'Sites to Search'
  - Give it any site on creation, and then remove it when it's selected, unless you want to emphasize that site(s).
2. Turn on images in Edit Search Engine > Setup > Basic > Image Search
3. Get the CSE ID in Edit Search Engine > Setup > Basic > Details (via [these instructions](https://support.google.com/customsearch/answer/2649143?hl=en))
4. Get the CSE KEY here https://code.google.com/apis/console
  - You will need a project, you may reuse an existing one, or create a new one
  - Select the project
  - Goto the API manager and create a server credential and use the key from that credential
5. Enable Custom Search API
  - https://console.developers.google.com
  - Select "Enable APIs and get credentials like keys" in your new project
  - Click "Custom Search API"
  - Click the button "Enable API"
6. Update your conf (and your modules if necessary)

### Custom Mustachification Service

To enable the `mustache me` feature, set the environment variable  `HUBOT_MUSTACHIFY_URL`
to your mustachify server url. More info and the source code of mustachify can be
found at [https://github.com/afeld/mustachio](https://github.com/afeld/mustachio)

### Listen for `image me` and `animate me`

If you want to have your bot respond to any chat that begins with `image me` or
`animate me`, you can add `HUBOT_GOOGLE_IMAGES_HEAR` to a non-empty value to
have the robot listen to all chat.

## Sample Interaction

```
user1>> hubot image me bananas
hubot>> http://upload.wikimedia.org/wikipedia/commons/4/4c/Bananas.jpg
user2>> hubot animate me it's happening
hubot>> http://i.kinja-img.com/gawker-media/image/upload/s--8U6TKXoi--/thfydh8egnt8he5esoz8.gif
user3>> hubot mustache me family portrait
hubot>> http://mustachify.me/1?src=http://www.daviddanielsphotography.com/wp-content/uploads/2013/03/Chowen-Family-Portraits-east-of-Park-City-13.jpg
```

---
_Source: https://npm.io/package/hubot-google-images · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
