movlog 0.3.15 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e0a0539a660bf4e6de2fe943e754bbd41b706d17
4
- data.tar.gz: 582346f75eaf10258483c12ba688e454a83cf85c
3
+ metadata.gz: d92d543f2f00830e0a5e92e25a8e72bc62bc5dd6
4
+ data.tar.gz: f426423e5683e0268bbf314e203f8572dcffcff4
5
5
  SHA512:
6
- metadata.gz: 5cd77e5881dd640a2077c198e5a2ba44b970f11f85dffa9c06195c9915162d4caf99001ce613f83a60f1c1b6f9db629dbaa2f24e5ffe7cf4eb1aa5d0bc20690d
7
- data.tar.gz: 14cc83648702cecb16aa076e42cdfc8c3621b3e7d204d3f65af256b2344144c72219d3502fa07c281e54c13a013697933025957e507a347a76cb055db8668899
6
+ metadata.gz: de5eda0ed7f2e58fba81e7f1ab9f41a3fc784c2747c29e08ca016bd34364fc64a368c31eb8c4dbc71aa863a2b540a60466e34d14c8c93101a76bb4d00bb475c3
7
+ data.tar.gz: dc02aa10cc748e1621813e9c46f6da682192e51bb0f8fc6c1bdb5cd917e6ac2b712cc0a37118644b62c15ff7ed61599bae35ab9b2bf20e7fadc8337540530848
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- module Geonames
3
+ module Airports
4
4
  # airport
5
5
  class AirportInfo
6
6
  attr_reader :location
@@ -9,13 +9,13 @@ module Geonames
9
9
 
10
10
  def initialize(data)
11
11
  @location = data[:location]
12
- load_geocoord(data[:geocoord])
12
+ load_geocode(data[:geocode])
13
13
  end
14
14
 
15
15
  def self.find(location)
16
16
  data = {
17
17
  location: location,
18
- geocoord: GeonamesApi.geo_info(location)
18
+ geocode: GoogleMapApi.geocode(location)
19
19
  }
20
20
  new(data)
21
21
  end
@@ -27,20 +27,21 @@ module Geonames
27
27
 
28
28
  private
29
29
 
30
- def load_geocoord(data)
30
+ def load_geocode(data)
31
+ data = data['geometry']['location']
31
32
  @lat = data['lat'].to_f
32
33
  @lng = data['lng'].to_f
33
34
  end
34
35
 
35
36
  def load_airport(airports)
36
37
  airports.map do |ap|
37
- if ap['name'].include? 'Airport'
38
+ if ap['name'].include? 'Air'
38
39
  {
39
40
  name: ap['name'], country_code: ap['countryCode'],
40
41
  lat: ap['lat'].to_f, lng: ap['lng'].to_f
41
42
  }
42
43
  end
43
- end
44
+ end.compact
44
45
  end
45
46
  end
46
47
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require 'http'
3
3
 
4
- module Geonames
4
+ module Airports
5
5
  # Service for transformation of location and find near airport
6
6
  class GeonamesApi
7
7
  GEONAMES_URL = 'http://api.geonames.org'
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+ require 'http'
3
+
4
+ module Airports
5
+ # Service to transform location to geocode
6
+ class GoogleMapApi
7
+ GOOGLEMAP_URL = 'https://maps.googleapis.com'
8
+ SEARCH_URL = [GOOGLEMAP_URL, 'maps/api/geocode/json'].join('/')
9
+
10
+ def self.config=(credentials)
11
+ @config = {} unless @config
12
+ @config.update(credentials)
13
+ end
14
+
15
+ def self.config
16
+ return @config if @config
17
+ @config = {
18
+ key: ENV['GOOGLEMAP_KEY']
19
+ }
20
+ end
21
+
22
+ def self.geocode(location)
23
+ search_response = HTTP.get(
24
+ SEARCH_URL,
25
+ params: {
26
+ address: location,
27
+ key: config[:key]
28
+ }
29
+ )
30
+ JSON.parse(search_response.to_s)['results'].first
31
+ end
32
+ end
33
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Movlog
4
- VERSION = '0.3.15'
4
+ VERSION = '0.4.0'
5
5
  end
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
  require_relative 'spec_helper.rb'
3
3
 
4
- describe 'Geonames specifications' do
4
+ describe 'Airports specifications' do
5
5
  before do
6
6
  VCR.insert_cassette CASSETTE_FILE_4, record: :new_episodes
7
7
  end
@@ -11,16 +11,15 @@ describe 'Geonames specifications' do
11
11
  end
12
12
 
13
13
  it 'should get geocoord from Geonames' do
14
- airport_info = Geonames::AirportInfo.find('Hsinchu')
14
+ airport_info = Airports::AirportInfo.find('Hsinchu')
15
15
 
16
16
  airport_info.lat.wont_be_nil
17
17
  airport_info.lng.wont_be_nil
18
18
  end
19
19
 
20
20
  it 'should get airport by geocoord from Geonames' do
21
- airport_info = Geonames::AirportInfo.find('Hsinchu')
21
+ airport_info = Airports::AirportInfo.find('Canterbury, New Zealand')
22
22
  airports = airport_info.airports
23
-
24
23
  airports.length.must_be :>, 0
25
24
  end
26
25
  end
@@ -0,0 +1,240 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://maps.googleapis.com/maps/api/geocode/json?address=Hsinchu&key=<GOOGLEMAP_KEY>
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Connection:
11
+ - close
12
+ Host:
13
+ - maps.googleapis.com
14
+ User-Agent:
15
+ - http.rb/2.1.0
16
+ response:
17
+ status:
18
+ code: 200
19
+ message: OK
20
+ headers:
21
+ Content-Type:
22
+ - application/json; charset=UTF-8
23
+ Date:
24
+ - Sat, 31 Dec 2016 08:21:01 GMT
25
+ Expires:
26
+ - Sun, 01 Jan 2017 08:21:01 GMT
27
+ Cache-Control:
28
+ - public, max-age=86400
29
+ Access-Control-Allow-Origin:
30
+ - "*"
31
+ Server:
32
+ - mafe
33
+ X-Xss-Protection:
34
+ - 1; mode=block
35
+ X-Frame-Options:
36
+ - SAMEORIGIN
37
+ Alt-Svc:
38
+ - quic=":443"; ma=2592000; v="35,34"
39
+ Accept-Ranges:
40
+ - none
41
+ Vary:
42
+ - Accept-Language,Accept-Encoding
43
+ Connection:
44
+ - close
45
+ body:
46
+ encoding: UTF-8
47
+ string: |
48
+ {
49
+ "results" : [
50
+ {
51
+ "address_components" : [
52
+ {
53
+ "long_name" : "Hsinchu City",
54
+ "short_name" : "Hsinchu City",
55
+ "types" : [ "administrative_area_level_2", "political" ]
56
+ },
57
+ {
58
+ "long_name" : "Taiwan",
59
+ "short_name" : "TW",
60
+ "types" : [ "country", "political" ]
61
+ },
62
+ {
63
+ "long_name" : "300",
64
+ "short_name" : "300",
65
+ "types" : [ "postal_code" ]
66
+ }
67
+ ],
68
+ "formatted_address" : "Hsinchu City, Taiwan 300",
69
+ "geometry" : {
70
+ "bounds" : {
71
+ "northeast" : {
72
+ "lat" : 24.8569956,
73
+ "lng" : 121.0335449
74
+ },
75
+ "southwest" : {
76
+ "lat" : 24.7125478,
77
+ "lng" : 120.8785096
78
+ }
79
+ },
80
+ "location" : {
81
+ "lat" : 24.8138297,
82
+ "lng" : 120.9674752
83
+ },
84
+ "location_type" : "APPROXIMATE",
85
+ "viewport" : {
86
+ "northeast" : {
87
+ "lat" : 24.8569956,
88
+ "lng" : 121.0335449
89
+ },
90
+ "southwest" : {
91
+ "lat" : 24.7125478,
92
+ "lng" : 120.8794077
93
+ }
94
+ }
95
+ },
96
+ "place_id" : "ChIJ9-datXdKaDQR-x-h4mLoTF4",
97
+ "types" : [ "administrative_area_level_2", "political" ]
98
+ }
99
+ ],
100
+ "status" : "OK"
101
+ }
102
+ http_version:
103
+ recorded_at: Sat, 31 Dec 2016 08:21:01 GMT
104
+ - request:
105
+ method: get
106
+ uri: https://maps.googleapis.com/maps/api/geocode/json?address=Canterbury,%20New%20Zealand&key=<GOOGLEMAP_KEY>
107
+ body:
108
+ encoding: US-ASCII
109
+ string: ''
110
+ headers:
111
+ Connection:
112
+ - close
113
+ Host:
114
+ - maps.googleapis.com
115
+ User-Agent:
116
+ - http.rb/2.1.0
117
+ response:
118
+ status:
119
+ code: 200
120
+ message: OK
121
+ headers:
122
+ Content-Type:
123
+ - application/json; charset=UTF-8
124
+ Date:
125
+ - Sat, 31 Dec 2016 08:21:01 GMT
126
+ Expires:
127
+ - Sun, 01 Jan 2017 08:21:01 GMT
128
+ Cache-Control:
129
+ - public, max-age=86400
130
+ Access-Control-Allow-Origin:
131
+ - "*"
132
+ Server:
133
+ - mafe
134
+ X-Xss-Protection:
135
+ - 1; mode=block
136
+ X-Frame-Options:
137
+ - SAMEORIGIN
138
+ Alt-Svc:
139
+ - quic=":443"; ma=2592000; v="35,34"
140
+ Accept-Ranges:
141
+ - none
142
+ Vary:
143
+ - Accept-Language,Accept-Encoding
144
+ Connection:
145
+ - close
146
+ body:
147
+ encoding: UTF-8
148
+ string: |
149
+ {
150
+ "results" : [
151
+ {
152
+ "address_components" : [
153
+ {
154
+ "long_name" : "Canterbury",
155
+ "short_name" : "Canterbury",
156
+ "types" : [ "administrative_area_level_1", "political" ]
157
+ },
158
+ {
159
+ "long_name" : "New Zealand",
160
+ "short_name" : "NZ",
161
+ "types" : [ "country", "political" ]
162
+ }
163
+ ],
164
+ "formatted_address" : "Canterbury, New Zealand",
165
+ "geometry" : {
166
+ "bounds" : {
167
+ "northeast" : {
168
+ "lat" : -41.9073951,
169
+ "lng" : 174.0956747
170
+ },
171
+ "southwest" : {
172
+ "lat" : -44.9402681,
173
+ "lng" : 169.8520438
174
+ }
175
+ },
176
+ "location" : {
177
+ "lat" : -43.7542275,
178
+ "lng" : 171.1637245
179
+ },
180
+ "location_type" : "APPROXIMATE",
181
+ "viewport" : {
182
+ "northeast" : {
183
+ "lat" : -41.9073951,
184
+ "lng" : 174.0956079
185
+ },
186
+ "southwest" : {
187
+ "lat" : -44.9402681,
188
+ "lng" : 169.8520438
189
+ }
190
+ }
191
+ },
192
+ "place_id" : "ChIJA9l1eDPYLW0RgeJpMTBkdzM",
193
+ "types" : [ "administrative_area_level_1", "political" ]
194
+ }
195
+ ],
196
+ "status" : "OK"
197
+ }
198
+ http_version:
199
+ recorded_at: Sat, 31 Dec 2016 08:21:02 GMT
200
+ - request:
201
+ method: get
202
+ uri: http://api.geonames.org/findNearbyJSON?fcode=AIRP&lat=-43.7542275&lng=171.1637245&maxRows=10&radius=50&username=<GEONAMES_USERNAME>
203
+ body:
204
+ encoding: US-ASCII
205
+ string: ''
206
+ headers:
207
+ Connection:
208
+ - close
209
+ Host:
210
+ - api.geonames.org
211
+ User-Agent:
212
+ - http.rb/2.1.0
213
+ response:
214
+ status:
215
+ code: 200
216
+ message: OK
217
+ headers:
218
+ Date:
219
+ - Sat, 31 Dec 2016 08:21:02 GMT
220
+ Server:
221
+ - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips
222
+ Cache-Control:
223
+ - no-cache
224
+ Access-Control-Allow-Origin:
225
+ - "*"
226
+ Connection:
227
+ - close
228
+ Transfer-Encoding:
229
+ - chunked
230
+ Content-Type:
231
+ - application/json;charset=UTF-8
232
+ body:
233
+ encoding: UTF-8
234
+ string: '{"geonames":[{"adminCode1":"E9","lng":"171.53011","distance":"34.82599","geonameId":6216856,"toponymName":"Mount
235
+ Hutt Methven Airfield","countryId":"2186224","fcl":"S","population":0,"countryCode":"NZ","name":"Mount
236
+ Hutt Methven Airfield","fclName":"spot, building, farm","countryName":"New
237
+ Zealand","fcodeName":"airport","adminName1":"Canterbury","lat":"-43.58832","fcode":"AIRP"}]}'
238
+ http_version:
239
+ recorded_at: Sat, 31 Dec 2016 08:21:03 GMT
240
+ recorded_with: VCR 3.0.3
@@ -16,7 +16,7 @@ CASSETTES_FOLDER = "#{FIXTURES_FOLDER}/cassettes"
16
16
  CASSETTE_FILE_1 = 'omdb_api'
17
17
  CASSETTE_FILE_2 = 'skyscanner_api'
18
18
  CASSETTE_FILE_3 = 'airbnb_api'
19
- CASSETTE_FILE_4 = 'geonames_api'
19
+ CASSETTE_FILE_4 = 'airports_api'
20
20
 
21
21
  OMDB_KEYWORD = 'hobbit'
22
22
 
@@ -25,6 +25,7 @@ if File.file?('config/credentials.yml')
25
25
  ENV['AIRBNB_CLIENT_ID'] = credentials[:airbnb_client_id]
26
26
  ENV['SKY_API_KEY'] = credentials[:skyscanner_api_key]
27
27
  ENV['GEONAMES_USERNAME'] = credentials[:geonames_username]
28
+ ENV['GOOGLEMAP_KEY'] = credentials[:googlemap_key]
28
29
  end
29
30
 
30
31
  VCR.configure do |c|
@@ -34,9 +35,10 @@ VCR.configure do |c|
34
35
  c.filter_sensitive_data('<SKY_API_KEY>') { ENV['SKY_API_KEY'] }
35
36
  c.filter_sensitive_data('<AIRBNB_CLIENT_ID>') { ENV['AIRBNB_CLIENT_ID'] }
36
37
  c.filter_sensitive_data('<GEONAMES_USERNAME>') { ENV['GEONAMES_USERNAME'] }
38
+ c.filter_sensitive_data('<GOOGLEMAP_KEY>') { ENV['GOOGLEMAP_KEY'] }
37
39
  end
38
40
 
39
41
  RESULT_FILE_1 = "#{FIXTURES_FOLDER}/omdb_api_results.yml"
40
42
  RESULT_FILE_2 = "#{FIXTURES_FOLDER}/skyscanner_api_results.yml"
41
43
  RESULT_FILE_3 = "#{FIXTURES_FOLDER}/airbnb_api_results.yml"
42
- RESULT_FILE_4 = "#{FIXTURES_FOLDER}/geonames_api_results.yml"
44
+ RESULT_FILE_4 = "#{FIXTURES_FOLDER}/airports_api_results.yml"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: movlog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.15
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Wen
@@ -197,6 +197,7 @@ files:
197
197
  - lib/movlog/airbnb_api.rb
198
198
  - lib/movlog/airport.rb
199
199
  - lib/movlog/geonames_api.rb
200
+ - lib/movlog/googlemap_api.rb
200
201
  - lib/movlog/movie.rb
201
202
  - lib/movlog/movies.rb
202
203
  - lib/movlog/omdb_api.rb
@@ -208,11 +209,11 @@ files:
208
209
  - lib/movlog/version.rb
209
210
  - movlog.gemspec
210
211
  - spec/airbnb_spec.rb
212
+ - spec/airports_spec.rb
211
213
  - spec/fixtures/cassettes/airbnb_api.yml
212
- - spec/fixtures/cassettes/geonames_api.yml
214
+ - spec/fixtures/cassettes/airports_api.yml
213
215
  - spec/fixtures/cassettes/omdb_api.yml
214
216
  - spec/fixtures/cassettes/skyscanner_api.yml
215
- - spec/geonames_spec.rb
216
217
  - spec/omdb_spec.rb
217
218
  - spec/skyscanner_spec.rb
218
219
  - spec/spec_helper.rb
@@ -242,11 +243,11 @@ specification_version: 4
242
243
  summary: Gets movie content from omdb
243
244
  test_files:
244
245
  - spec/airbnb_spec.rb
246
+ - spec/airports_spec.rb
245
247
  - spec/fixtures/cassettes/airbnb_api.yml
246
- - spec/fixtures/cassettes/geonames_api.yml
248
+ - spec/fixtures/cassettes/airports_api.yml
247
249
  - spec/fixtures/cassettes/omdb_api.yml
248
250
  - spec/fixtures/cassettes/skyscanner_api.yml
249
- - spec/geonames_spec.rb
250
251
  - spec/omdb_spec.rb
251
252
  - spec/skyscanner_spec.rb
252
253
  - spec/spec_helper.rb
@@ -1,242 +0,0 @@
1
- ---
2
- http_interactions:
3
- - request:
4
- method: get
5
- uri: http://api.geonames.org//searchJSON?fuzzy=0.5&maxRows=1&q=Hsinchu&username=
6
- body:
7
- encoding: US-ASCII
8
- string: ''
9
- headers:
10
- Connection:
11
- - close
12
- Host:
13
- - api.geonames.org
14
- User-Agent:
15
- - http.rb/2.0.3
16
- response:
17
- status:
18
- code: 200
19
- message: OK
20
- headers:
21
- Date:
22
- - Tue, 15 Nov 2016 09:17:05 GMT
23
- Server:
24
- - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips PHP/5.4.16
25
- Cache-Control:
26
- - no-cache
27
- Access-Control-Allow-Origin:
28
- - "*"
29
- Content-Length:
30
- - '52'
31
- Connection:
32
- - close
33
- Content-Type:
34
- - application/json;charset=UTF-8
35
- body:
36
- encoding: UTF-8
37
- string: '{"status":{"message":"invalid username","value":10}}'
38
- http_version:
39
- recorded_at: Tue, 15 Nov 2016 09:17:05 GMT
40
- - request:
41
- method: get
42
- uri: http://api.geonames.org//searchJSON?fuzzy=0.5&maxRows=1&q=Hsinchu&username=<GEONAMES_USERNAME>
43
- body:
44
- encoding: US-ASCII
45
- string: ''
46
- headers:
47
- Connection:
48
- - close
49
- Host:
50
- - api.geonames.org
51
- User-Agent:
52
- - http.rb/2.0.3
53
- response:
54
- status:
55
- code: 200
56
- message: OK
57
- headers:
58
- Date:
59
- - Tue, 15 Nov 2016 09:20:56 GMT
60
- Server:
61
- - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips PHP/5.4.16
62
- Cache-Control:
63
- - no-cache
64
- Access-Control-Allow-Origin:
65
- - "*"
66
- Connection:
67
- - close
68
- Transfer-Encoding:
69
- - chunked
70
- Content-Type:
71
- - application/json;charset=UTF-8
72
- body:
73
- encoding: UTF-8
74
- string: '{"totalResultsCount":707,"geonames":[{"adminCode1":"04","lng":"120.96861","geonameId":1675151,"toponymName":"Hsinchu","countryId":"1668284","fcl":"P","population":404109,"countryCode":"TW","name":"Hsinchu","fclName":"city,
75
- village,...","countryName":"Taiwan","fcodeName":"seat of a second-order administrative
76
- division","adminName1":"Taiwan","lat":"24.80361","fcode":"PPLA2"}]}'
77
- http_version:
78
- recorded_at: Tue, 15 Nov 2016 09:20:56 GMT
79
- - request:
80
- method: get
81
- uri: http://api.geonames.org//findNearbyJSON?fcode=AIRP&lat=24.80361&lng=120.96861&maxRows=10&radius=50&username=<GEONAMES_USERNAME>
82
- body:
83
- encoding: US-ASCII
84
- string: ''
85
- headers:
86
- Connection:
87
- - close
88
- Host:
89
- - api.geonames.org
90
- User-Agent:
91
- - http.rb/2.0.3
92
- response:
93
- status:
94
- code: 200
95
- message: OK
96
- headers:
97
- Date:
98
- - Tue, 15 Nov 2016 09:26:04 GMT
99
- Server:
100
- - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips PHP/5.4.16
101
- Cache-Control:
102
- - no-cache
103
- Access-Control-Allow-Origin:
104
- - "*"
105
- Connection:
106
- - close
107
- Transfer-Encoding:
108
- - chunked
109
- Content-Type:
110
- - application/json;charset=UTF-8
111
- body:
112
- encoding: UTF-8
113
- string: '{"geonames":[{"adminCode1":"04","lng":"120.93939","distance":"3.35823","geonameId":6300303,"toponymName":"Hsinchu
114
- Tw-Afb","countryId":"1668284","fcl":"S","population":0,"countryCode":"TW","name":"Hsinchu
115
- Tw-Afb","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"24.81803","fcode":"AIRP"},{"adminCode1":"04","lng":"120.94111","distance":"3.61322","geonameId":6600395,"toponymName":"Xinzhu
116
- Jichang","countryId":"1668284","fcl":"S","population":0,"countryCode":"TW","name":"Xinzhu
117
- Jichang","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"24.82444","fcode":"AIRP"},{"adminCode1":"04","lng":"121.23282","distance":"40.42421","geonameId":1980018,"toponymName":"Taiwan
118
- Taoyuan International Airport","countryId":"1668284","fcl":"S","population":0,"countryCode":"TW","name":"Taiwan
119
- Taoyuan International Airport","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"25.07773","fcode":"AIRP"}]}'
120
- http_version:
121
- recorded_at: Tue, 15 Nov 2016 09:26:05 GMT
122
- - request:
123
- method: get
124
- uri: http://api.geonames.org/searchJSON?fuzzy=0.5&maxRows=1&q=Hsinchu&username=<GEONAMES_USERNAME>
125
- body:
126
- encoding: US-ASCII
127
- string: ''
128
- headers:
129
- Connection:
130
- - close
131
- Host:
132
- - api.geonames.org
133
- User-Agent:
134
- - http.rb/2.1.0
135
- response:
136
- status:
137
- code: 200
138
- message: OK
139
- headers:
140
- Date:
141
- - Fri, 25 Nov 2016 05:10:01 GMT
142
- Server:
143
- - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips
144
- Cache-Control:
145
- - no-cache
146
- Access-Control-Allow-Origin:
147
- - "*"
148
- Connection:
149
- - close
150
- Transfer-Encoding:
151
- - chunked
152
- Content-Type:
153
- - application/json;charset=UTF-8
154
- body:
155
- encoding: UTF-8
156
- string: '{"totalResultsCount":707,"geonames":[{"adminCode1":"04","lng":"120.96861","geonameId":1675151,"toponymName":"Hsinchu","countryId":"1668284","fcl":"P","population":404109,"countryCode":"TW","name":"Hsinchu","fclName":"city,
157
- village,...","countryName":"Taiwan","fcodeName":"seat of a second-order administrative
158
- division","adminName1":"Taiwan","lat":"24.80361","fcode":"PPLA2"}]}'
159
- http_version:
160
- recorded_at: Fri, 25 Nov 2016 05:10:01 GMT
161
- - request:
162
- method: get
163
- uri: http://api.geonames.org/findNearbyJSON?fcode=AIRP&lat=24.80361&lng=120.96861&maxRows=10&radius=50&username=<GEONAMES_USERNAME>
164
- body:
165
- encoding: US-ASCII
166
- string: ''
167
- headers:
168
- Connection:
169
- - close
170
- Host:
171
- - api.geonames.org
172
- User-Agent:
173
- - http.rb/2.1.0
174
- response:
175
- status:
176
- code: 200
177
- message: OK
178
- headers:
179
- Date:
180
- - Fri, 25 Nov 2016 05:10:02 GMT
181
- Server:
182
- - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips
183
- Cache-Control:
184
- - no-cache
185
- Access-Control-Allow-Origin:
186
- - "*"
187
- Connection:
188
- - close
189
- Transfer-Encoding:
190
- - chunked
191
- Content-Type:
192
- - application/json;charset=UTF-8
193
- body:
194
- encoding: UTF-8
195
- string: '{"geonames":[{"adminCode1":"04","lng":"120.93939","distance":"3.35823","geonameId":6300303,"toponymName":"Hsinchu
196
- Tw-Afb","countryId":"1668284","fcl":"S","population":0,"countryCode":"TW","name":"Hsinchu
197
- Tw-Afb","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"24.81803","fcode":"AIRP"},{"adminCode1":"04","lng":"120.94111","distance":"3.61322","geonameId":6600395,"toponymName":"Xinzhu
198
- Jichang","countryId":"1668284","fcl":"S","population":0,"countryCode":"TW","name":"Xinzhu
199
- Jichang","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"24.82444","fcode":"AIRP"},{"adminCode1":"04","lng":"121.23282","distance":"40.42421","geonameId":1980018,"toponymName":"Taiwan
200
- Taoyuan International Airport","countryId":"1668284","fcl":"S","population":0,"countryCode":"TW","name":"Taiwan
201
- Taoyuan International Airport","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"25.07773","fcode":"AIRP"}]}'
202
- http_version:
203
- recorded_at: Fri, 25 Nov 2016 05:10:02 GMT
204
- - request:
205
- method: get
206
- uri: http://api.geonames.org/searchJSON?fuzzy=0.5&maxRows=1&q=Ajim&username=<GEONAMES_USERNAME>
207
- body:
208
- encoding: US-ASCII
209
- string: ''
210
- headers:
211
- Connection:
212
- - close
213
- Host:
214
- - api.geonames.org
215
- User-Agent:
216
- - http.rb/2.1.0
217
- response:
218
- status:
219
- code: 200
220
- message: OK
221
- headers:
222
- Date:
223
- - Fri, 25 Nov 2016 07:52:52 GMT
224
- Server:
225
- - Apache/2.4.6 (CentOS) mod_jk/1.2.41 OpenSSL/1.0.1e-fips
226
- Cache-Control:
227
- - no-cache
228
- Access-Control-Allow-Origin:
229
- - "*"
230
- Connection:
231
- - close
232
- Transfer-Encoding:
233
- - chunked
234
- Content-Type:
235
- - application/json;charset=UTF-8
236
- body:
237
- encoding: UTF-8
238
- string: '{"totalResultsCount":103,"geonames":[{"adminCode1":"28","lng":"10.75664","geonameId":2473937,"toponymName":"Ajim","countryId":"2464461","fcl":"P","population":0,"countryCode":"TN","name":"Ajim","fclName":"city,
239
- village,...","countryName":"Tunisia","fcodeName":"populated place","adminName1":"Madanīn","lat":"33.72638","fcode":"PPL"}]}'
240
- http_version:
241
- recorded_at: Fri, 25 Nov 2016 07:52:53 GMT
242
- recorded_with: VCR 3.0.3