Skip to content

Commit

Permalink
add debug
Browse files Browse the repository at this point in the history
  • Loading branch information
aaripurna committed Oct 16, 2019
1 parent 1a0bac9 commit 56dae19
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions scraper.rb
Expand Up @@ -21,16 +21,15 @@
hotel_name = hotel_name_link.at_css('.sr-hotel__name').text.strip
hotel_coordinate = item.at_css('.bui-link').attr('data-coords').strip.split(',').reverse.join(',')

candidate = HTTP.get("https://maps.googleapis.com/maps/api/place/findplacefromtext/json", :params => {
request = HTTP.get("https://maps.googleapis.com/maps/api/place/findplacefromtext/json", :params => {
input: hotel_name,
key: api_key,
inputtype: 'textquery'
}).parse['candidates'].first || {}
})

place_id = candidate['place_id']
puts candidate
puts hotel_name
candidate = if request.status == 200 ? request.parse["candidates"].first : {}

place_id = candidate["place_id"]

contancts = HTTP.get('https://maps.googleapis.com/maps/api/place/details/json', :params => {
key: api_key,
Expand Down

0 comments on commit 56dae19

Please sign in to comment.