<commit_before>require_relative 'config/application'

# puts "Put your application code in #{File.expand_path(__FILE__)}"


# Controller.options(ARGV[0], ARGV[1..-1])
# options = ['search', 'display  ]


puts "*~*~*~*~* WELCOME TO YELPIE *~*~*~*~*"
sleep(0.5)
puts "...for broke ass DBC students"
sleep(1.5)
puts "What type of food do you want to devour"
food_type = gets.chomp

# YOUR_CONSUMER_KEY = 'QCX_Wf09d5RnoOr6MaGl1w'
# YOUR_CONSUMER_SECRET = '<KEY>'
# YOUR_TOKEN = '<KEY>'
# YOUR_TOKEN_SECRET = '<KEY>'


Yelp.client.configure do |config|
  config.consumer_key = 'QCX_Wf09d5RnoOr6MaGl1w'
  config.consumer_secret = '<KEY>'
  config.token = '<KEY>'
  config.token_secret = '<KEY>'
end

response = Yelp.client.search('633 folsom, san francisco', { term: food_type })
puts response.businesses[0].name
puts response.businesses[0].rating
# puts response.businesses[0].display_address<commit_msg>added distance and rating<commit_after>require_relative 'config/application'

# puts "Put your application code in #{File.expand_path(__FILE__)}"


# Controller.options(ARGV[0], ARGV[1..-1])
# options = ['search', 'display  ]


puts "*~*~*~*~* WELCOME TO YELPIE *~*~*~*~*"
sleep(0.5)
puts "...for broke ass DBC students"
sleep(1.5)
puts "What type of food do you want to devour"
food_type = gets.chomp
puts

# YOUR_CONSUMER_KEY = 'QCX_Wf09d5RnoOr6MaGl1w'
# YOUR_CONSUMER_SECRET = '<KEY>'
# YOUR_TOKEN = '<KEY>'
# YOUR_TOKEN_SECRET = '<KEY>'


Yelp.client.configure do |config|
  config.consumer_key = 'QCX_Wf09d5RnoOr6MaGl1w'
  config.consumer_secret = '<KEY>'
  config.token = '<KEY>'
  config.token_secret = '<KEY>'
end


parameters = { term: food_type,
  limit: 10,
  radius_filter: 1600, #in meters = 1 miles
  sort: 1, # 0:best matched(default), 1: distance, 2: highest rated
}

coordinates = { latitude: 37.784900, longitude: -122.397398}

response = Yelp.client.search_by_coordinates(coordinates, parameters)
puts "*~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~*"
response.businesses.each do |x|
  ap x.name
  ap x.distance.floor
  ap x.rating
  puts "*~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~**~*~*~*~*"
end
#puts response.businesses[0].rating

# puts response.businesses[0].display_address
{'fraction_non_alphanumeric': 0.2, 'fraction_numerical': 0.03146067415730337, 'mean_word_length': 5.47093023255814, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, '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': '6279886', 'n_tokens_mistral': 972, 'n_tokens_neox': 852, 'n_words': 176}