• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

hubot-scripts/hubot-google-images: A hubot script that interacts with the Google ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

hubot-scripts/hubot-google-images

开源软件地址(OpenSource Url):

https://github.com/hubot-scripts/hubot-google-images

开源编程语言(OpenSource Language):

CoffeeScript 80.8%

开源软件介绍(OpenSource Introduction):

hubot-google-images

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

See 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:

[
  "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 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 for free. If you need more than that you'll have to pay.

CSE setup details

  1. Create a CSE via these instructions.
  • 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).
  1. Turn on images in Edit Search Engine > Setup > Basic > Image Search
  2. Get the CSE ID in Edit Search Engine > Setup > Basic > Details (via these instructions)
  3. 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
  1. Enable Custom Search API
  1. 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

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



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap