Time_Traveler 0.1.70 → 0.1.71
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/bin/googleplace +0 -0
- data/lib/Time_Traveler/airbnb_api.rb +7 -0
- data/lib/Time_Traveler/rentInfo.rb +11 -3
- data/lib/Time_Traveler/skyscanner_api.rb +2 -1
- data/lib/Time_Traveler/version.rb +1 -1
- data/spec/skyscanner_spec.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ebceabc70a038f8d23e3b8bda29bfe7107484baa
|
|
4
|
+
data.tar.gz: da4c4c91f1b2250ccdf3cbcd07ad3a7459c0d522
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 042309b39137616272e5c52fa11dfea3791e2281cd9f5160f2cfca104322e6c54475a85abf7cf8f0d672bee075fa24ea3b6dbdc40038d96f201afd622c50d13f
|
|
7
|
+
data.tar.gz: e914b49f162cbb473afb2f098ea4ffced8736099b5977eaf5ab6768ce44ec1529430d06fb260407d1d3b41db7e6274b0c7fca3e7e5a6a6a191f16ddeb1206669
|
data/bin/googleplace
CHANGED
|
File without changes
|
|
@@ -8,6 +8,7 @@ module Airbnb
|
|
|
8
8
|
API_VER = 'v2'
|
|
9
9
|
Airbnb_API_URL = URI.join(Airbnb_URL, "#{API_VER}/")
|
|
10
10
|
Search_URL = URI.join(Airbnb_API_URL, "search_results")
|
|
11
|
+
Price_URL = URI.join(Airbnb_API_URL, "listings")
|
|
11
12
|
|
|
12
13
|
def self.config=(credentials)
|
|
13
14
|
@config ? @config.update(credentials) : @config = credentials
|
|
@@ -27,5 +28,11 @@ module Airbnb
|
|
|
27
28
|
|
|
28
29
|
end
|
|
29
30
|
|
|
31
|
+
# def self.findPrice(room_id)
|
|
32
|
+
# response = HTTP.get(Price_URL,
|
|
33
|
+
# params: { client_id: config[:airbnb_id],
|
|
34
|
+
# location: location
|
|
35
|
+
# })
|
|
36
|
+
|
|
30
37
|
end
|
|
31
38
|
end
|
|
@@ -25,11 +25,19 @@ module Airbnb
|
|
|
25
25
|
private
|
|
26
26
|
def room(item)
|
|
27
27
|
#item = item['listing']
|
|
28
|
+
room_id = item['listing']['id']
|
|
28
29
|
room = {
|
|
29
|
-
|
|
30
|
+
id: room_id,
|
|
30
31
|
name: item['listing']['name'],
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
# need to get price from airbnbAPI
|
|
33
|
+
# Basic Sample Request:
|
|
34
|
+
# https://api.airbnb.com/v2/listings/5116458?client_id=3092nxybyb0otqw18e8nh5nty&_format=v1_legacy_for_p3
|
|
35
|
+
address: item['listing']['public_address'],
|
|
36
|
+
airbnb_link: "https://www.airbnb.com.tw/rooms/" + room_id.to_s,
|
|
37
|
+
roomImg: item['listing']['picture_url'],
|
|
38
|
+
bed: item['listing']['beds'],
|
|
39
|
+
roomRank: item['listing']['star_rating']
|
|
40
|
+
|
|
33
41
|
}
|
|
34
42
|
end
|
|
35
43
|
|
data/spec/skyscanner_spec.rb
CHANGED
|
@@ -17,8 +17,9 @@ describe 'Load specifications' do
|
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
it 'should be able to get the data from Skyscanner' do
|
|
20
|
-
skyscanner_load = Skyscanner::FlightInfo.find(market: 'TW', currency: 'TWD', locale: 'en-GB', originPlace: 'TW', destinationPlace: 'UK', outboundPartialDate: '
|
|
20
|
+
skyscanner_load = Skyscanner::FlightInfo.find(market: 'TW', currency: 'TWD', locale: 'en-GB', originPlace: 'TW', destinationPlace: 'UK', outboundPartialDate: 'anytime')
|
|
21
21
|
flightInfo = skyscanner_load.flightInfo
|
|
22
|
+
print skyscanner_load
|
|
22
23
|
flightInfo.length.must_be :>,0
|
|
23
24
|
end
|
|
24
25
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: Time_Traveler
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.71
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Yvonne Shih
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2016-11-
|
|
13
|
+
date: 2016-11-27 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: http
|