you_got_listed 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/you_got_listed/listings.rb +9 -15
- data/lib/you_got_listed/version.rb +1 -1
- metadata +3 -3
@@ -46,24 +46,18 @@ module YouGotListed
|
|
46
46
|
|
47
47
|
def find_all_by_ids(listing_ids, include_off_market = true)
|
48
48
|
listing_ids = listing_ids.split(',') if listing_ids.is_a?(String)
|
49
|
-
mls_ids = []
|
50
|
-
ygl_ids = []
|
51
49
|
all_listings = []
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
mls_ids << list_id
|
57
|
-
end
|
50
|
+
search_params = {}
|
51
|
+
search_params[:include_off_market] = 1 if include_off_market
|
52
|
+
if listing_ids.any?{|list_id| list_id =~ /^[0-9]{8}$/}
|
53
|
+
search_params[:include_mls] = 1
|
58
54
|
end
|
59
|
-
|
60
|
-
search_params = {:listing_ids => group.join(','), :page_count => 500, :page_index => (index + 1)}
|
61
|
-
search_params[:include_off_market] = 1 if include_off_market
|
55
|
+
listing_ids.in_groups_of(500, false).each_with_index do |group, index|
|
62
56
|
group.delete_if{|x| x.nil?}
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
all_listings <<
|
57
|
+
search_params[:listing_ids] = group.join(',')
|
58
|
+
search_params[:page_count] = 500
|
59
|
+
search_params[:page_index] = index + 1
|
60
|
+
all_listings << find_all(search_params)
|
67
61
|
end
|
68
62
|
all_listings.compact.flatten
|
69
63
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: you_got_listed
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 2
|
10
|
+
version: 0.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Tom Cocca
|