movlog 0.3.0 → 0.3.1
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 +4 -4
- data/lib/movlog/geonames_api.rb +1 -1
- data/lib/movlog/version.rb +1 -1
- data/spec/fixtures/cassettes/geonames_api.yml +82 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6bad24ddfc5a03256c6c44b378ae26e07a5d10af
|
|
4
|
+
data.tar.gz: fd1adc6493fe8ee5bd9fb0cebab9bdaa9bbdc003
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ec3a065105f2b28f333940e7e26ff6f6607c50dbfa2c9b3593b64c469c8c5e13329108d0250f61a59e39a7e7e5352453db5d7cffbf2b4d128c3d8bb607f08984
|
|
7
|
+
data.tar.gz: 3198b0d0a4c024f54331d29fc3cd055d7217eb4ae8106559a763da3bf0424b543abff4fddfb6b7dc9b92c40ae94f9928bd058410fd00603a897d8618be176495
|
data/lib/movlog/geonames_api.rb
CHANGED
|
@@ -4,7 +4,7 @@ require 'http'
|
|
|
4
4
|
module Geonames
|
|
5
5
|
# Service for transformation of location and find near airport
|
|
6
6
|
class GeonamesApi
|
|
7
|
-
GEONAMES_URL = 'http://api.geonames.org
|
|
7
|
+
GEONAMES_URL = 'http://api.geonames.org'
|
|
8
8
|
SEARCH_URL = [GEONAMES_URL, 'searchJSON'].join('/')
|
|
9
9
|
FIND_NEARBY_URL = [GEONAMES_URL, 'findNearbyJSON'].join('/')
|
|
10
10
|
|
data/lib/movlog/version.rb
CHANGED
|
@@ -119,4 +119,86 @@ http_interactions:
|
|
|
119
119
|
Taoyuan International Airport","fclName":"spot, building, farm","countryName":"Taiwan","fcodeName":"airport","adminName1":"Taiwan","lat":"25.07773","fcode":"AIRP"}]}'
|
|
120
120
|
http_version:
|
|
121
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
|
|
122
204
|
recorded_with: VCR 3.0.3
|