lib/chronicle/foursquare/proxy.rb in chronicle-foursquare-0.1.0 vs lib/chronicle/foursquare/proxy.rb in chronicle-foursquare-0.1.1

- old
+ new

@@ -7,17 +7,17 @@ def initialize(access_token: ) @access_token = access_token end - def load_visits(since: nil, limit: nil) + def load_checkins(since: nil, limit: nil) has_more = true visits = [] count = 0 while has_more - results = load_checkins(limit: 50, offset: count, since: since) + results = load_checkin_page(limit: 50, offset: count, since: since) results = results.first(limit - count) if limit visits += results count += results.length has_more = results.any? @@ -27,10 +27,10 @@ def load_self load_endpoint('users/self')[:response][:user] end - def load_checkins(limit: 50, offset: 0, since: nil) + def load_checkin_page(limit: 50, offset: 0, since: nil) params = { limit: limit, offset: offset, afterTimestamp: since.to_i }