Socket
Socket
Sign inDemoInstall

tjbot-places

Package Overview
Dependencies
15
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    tjbot-places

Simplified google places component for TBBot lab


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

TJBot Places Linrary

Introduction

This library was coded to allow for simplified access into the google places api for use with the IBM TJBot through Watson Assystant dialogs, thus you might find a very small subset of the places API functionality as it is intended to be used through a natural language dialog through voice.

Instructions

In order to use the library one should include it by requiring tjbot-places. Two functions are currently available, one that searches for a place by name getPlace(searchString) and another one that searches for places that are nearby a particular location and that respond to a particular keyword such as restaurant getPlacesNear(latitude, longitude, keyword).

Note: In order to use this library you need to get a Google API kye configured to use the Google Places api

const tjbot_places = require('tjbot-places');
 
const client = new tjbot_places('GOOGLEPLACES_APIKEY');

// Example to get a place by name and then get nearby restaurants
// in this case we will search for IBM Mexico's Offices
client.getPlace('ibm mexico').then(res =>{
    // show the json for the place object
	console.log(JSON.stringify(res));
	console.log("========================");
	var type="Restaurant";
    // query restaurants near ibm mexico
	client.getPlacesNear(res.latitude,res.longitude,type).then(res => {
		//The result is an array of places 
		res.forEach(function (elem){
			console.log(elem.name+' - '+elem.rating);
		});
	});
});

Keywords

FAQs

Last updated on 17 Jul 2018

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc