<commit_before>import request from 'superagent'
require('dotenv').config()
import queryString from 'query-string'



export default (lat = -41.2865, long = 174.7762, radius = 1000) => {
	let query = queryString.stringify({		
			location: lat + '\,' + long,
			radius: radius,
			types: 'cafe|restaurant|food|bakery',
			key: process.env.GOOGLE_API_KEY,

		},false)
	
console.log(query, "this is query")
console.log("----------------------")


	return new Promise ((resolve, rej) => {
		request
		  .get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?' + query )
		  .end(function(err, res){
		  	if(err) {
		  		console.log('there has been an error in superagent', err)
		  		rej(err)
		  	} else {
		  		
					resolve(res)	      
		    }
	   })	<commit_msg>remove open_hours and opening_hours<commit_after>import request from 'superagent'
require('dotenv').config()
import queryString from 'query-string'



export default (lat = -41.2865, long = 174.7762, radius = 1000) => {
	let query = queryString.stringify({		
			location: lat + ',' + long,
			radius: radius,
			types: 'cafe|restaurant|food|bakery',
			key: process.env.GOOGLE_API_KEY,

		},false)

	return new Promise ((resolve, rej) => {
		request
		  .get('https://maps.googleapis.com/maps/api/place/nearbysearch/json?' + query )
		  // .then((res) => {
		  	// let restArray = res.body.results
		  	// let nextPageToken = res.body.next_page_token
		  	// let cleanRestaurants = restArray.map( function ( restObj ) {
		  	// 	console.log("in map function", restObj)
		  		
		  	// 	return {
		  	// 		"id": restObj.id,
		  	// 		"name": restObj.name,
		  	// 		"open_now": restObj.opening_hours.open_now,
		  	// 	}
		  	// })
		  	// console.log(cleanRestaurants, "please be a nice clean object ")
		  	// console.log("------------------------------------------------")

		  // })
		  .end(function(err, res){
		  	if(err) {
		  		console.log('there has been an error in superagent', err)
		  		rej(err)
		  	} else {
		  		let restArray = res.body.results
		  	let nextPageToken = res.body.next_page_token
		  	let cleanRestaurants = restArray.map( function ( restObj ) {
		  		console.log("in map function", restObj.geometry)
		  		
		  		return {
		  			"id": restObj.id,
		  			"name": restObj.name//,
		  			// "open_now": restObj["opening_hours"]["open_now"]
		  		}
		  	})
		  	console.log(cleanRestaurants, "please be a nice clean object ")
		  	console.log("------------------------------------------------")
		  		
					resolve(cleanRestaurants)	      
		    }
	   })	
{'fraction_non_alphanumeric': 0.1881846635367762, 'fraction_numerical': 0.013302034428794992, 'mean_word_length': 2.2042606516290726, 'pattern_counts': {'":': 6, '<': 3, '<?xml version=': 0, '>': 8, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3477218', 'n_tokens_mistral': 1034, 'n_tokens_neox': 857, 'n_words': 173}