Code Monkey home page Code Monkey logo

image-search-wrapper-nodejs's Introduction

image-search-wrapper-nodejs

A Image search wrapper to google images, simply put in your appId and secret plugin as a route to expressjs

Demo

demo availible at https://lee182-google-image-api.herokuapp.com

endpoints

GET /recent

GET /search/katz

GET /search/dogs?offset=101&limit=3

API

GET /search/:img

GET /katz will respond with an array of results each containing

[
  {
    url: "https://i.ytimg.com/vi/sw3phlvDmpA/maxresdefault.jpg"
    snippet "Last Name Katz (Music Video) ..."
    thumbnail: "https://encrypted-tbn3.gs…9-Slz8M1p91QnmHD-M_AawKQ"
    context: "https://www.youtube.com/watch?v=sw3phlvDmpA"
  }
  ...
]

query ?offset=number (optional)

the offset query determines the number of results to skip over. by default the number is 0

query &limit=count (optional)

by default the limit is to 10 results

GET /recent

will return recent search queries in as a array

install on your server

$ npm install Lee182/image-search-wrapper-nodejs in server.js

const express = require('express')
const app = express()
const port = process.env.PORT || 8080

const img_search = require('./index.js')({
  history_cap: 10, // the size of the recent path which stores search queries
  cors: true, // enable Cross Origin Requests
  gg_id: process.env.GG_ID || require('./keys').GG_ID,
  gg_key: process.env.GG_KEY || require('./keys').GG_KEY,
})

app.use('/',img_search)

app.listen(port, function(){
  console.log('server listening at http://localhost:'+port)
})

GG_ID and GG_KEY can be obtained from (google)[https://google.com]

Author & Licence

Author: Jonathan T L Lee

Licence: MIT

Repo: https://github.com/Lee182/image-search-wrapper-nodejs

image-search-wrapper-nodejs's People

Contributors

lee182 avatar

Watchers

 avatar  avatar

Forkers

thisme124

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.