-
Notifications
You must be signed in to change notification settings - Fork 318
/
seven_wonders.rb
29 lines (19 loc) · 1.15 KB
/
seven_wonders.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'httparty'
require "awesome_print"
BASE_URL = "THE BASE URL FOR THE API REQUEST"
LOCATION_IQ_KEY = "YOUR API TOKEN"
def get_location(search_term)
end
def find_seven_wonders
seven_wonders = ["Great Pyramid of Giza", "Gardens of Babylon", "Colossus of Rhodes", "Pharos of Alexandria", "Statue of Zeus at Olympia", "Temple of Artemis", "Mausoleum at Halicarnassus"]
seven_wonders_locations = []
seven_wonders.each do |wonder|
sleep(0.5)
seven_wonders_locations << get_location(wonder)
end
return seven_wonders_locations
end
# Use awesome_print because it can format the output nicely
ap find_seven_wonders
# Expecting something like:
# [{"Great Pyramid of Giza"=>{:lat=>"29.9791264", :lon=>"31.1342383751015"}}, {"Gardens of Babylon"=>{:lat=>"50.8241215", :lon=>"-0.1506162"}}, {"Colossus of Rhodes"=>{:lat=>"36.3397076", :lon=>"28.2003164"}}, {"Pharos of Alexandria"=>{:lat=>"30.94795585", :lon=>"29.5235626430011"}}, {"Statue of Zeus at Olympia"=>{:lat=>"37.6379088", :lon=>"21.6300063"}}, {"Temple of Artemis"=>{:lat=>"32.2818952", :lon=>"35.8908989553238"}}, {"Mausoleum at Halicarnassus"=>{:lat=>"37.03788265", :lon=>"27.4241455276707"}}]