Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tjbot-places

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tjbot-places

Simplified google places component for TBBot lab

  • 1.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 17 Jul 2018

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc