chronicle-foursquare 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b127e38ea0c2b7e3393023e9d1deeab3b9b1ec098dbf8bcc1ad0dd16eb8ee107
|
4
|
+
data.tar.gz: 885e48e2f24f23182ff8ab04fae71caebb8713ba55e0e12b82f5f66c0ebc797a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d374d7055cc2eec0f690c5b2cc5f7f4bb62d985541064d3bc8215187f033b904660aa050b9b96faa00e6f10bedce4b753237779fbb6f0d4cf29548e1b0f40db
|
7
|
+
data.tar.gz: 3723eb0eec233292e9dc24c6d4e7b5db4f3854c6019ca3442a7d30659ed1d258b4833cf8a99d2f669a1e87abaaab636e4b2b0ea1799cb28ecc082906ddc33069
|
data/README.md
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Chronicle
|
2
2
|
module Foursquare
|
3
|
-
class
|
3
|
+
class CheckinsExtractor < Chronicle::ETL::Extractor
|
4
4
|
register_connector do |r|
|
5
5
|
r.provider = 'foursquare'
|
6
|
-
r.description = '
|
6
|
+
r.description = 'checkins'
|
7
7
|
end
|
8
8
|
|
9
9
|
setting :access_token, required: true
|
@@ -13,23 +13,23 @@ module Chronicle
|
|
13
13
|
|
14
14
|
@proxy = Chronicle::Foursquare::Proxy.new(access_token: @config.access_token)
|
15
15
|
@actor = load_actor
|
16
|
-
@
|
16
|
+
@checkins = load_checkins
|
17
17
|
end
|
18
18
|
|
19
19
|
def results_count
|
20
|
-
@
|
20
|
+
@checkins.count
|
21
21
|
end
|
22
22
|
|
23
23
|
def extract
|
24
|
-
@
|
25
|
-
yield Chronicle::ETL::Extraction.new(data:
|
24
|
+
@checkins.each do |checkin|
|
25
|
+
yield Chronicle::ETL::Extraction.new(data: checkin, meta: { actor: @actor})
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
29
|
private
|
30
30
|
|
31
|
-
def
|
32
|
-
@proxy.
|
31
|
+
def load_checkins
|
32
|
+
@proxy.load_checkins(limit: @config.limit, since: @config.since)
|
33
33
|
end
|
34
34
|
|
35
35
|
def load_actor
|
@@ -9,13 +9,13 @@ module Chronicle
|
|
9
9
|
@access_token = access_token
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
12
|
+
def load_checkins(since: nil, limit: nil)
|
13
13
|
has_more = true
|
14
14
|
visits = []
|
15
15
|
count = 0
|
16
16
|
|
17
17
|
while has_more
|
18
|
-
results =
|
18
|
+
results = load_checkin_page(limit: 50, offset: count, since: since)
|
19
19
|
results = results.first(limit - count) if limit
|
20
20
|
visits += results
|
21
21
|
|
@@ -29,7 +29,7 @@ module Chronicle
|
|
29
29
|
load_endpoint('users/self')[:response][:user]
|
30
30
|
end
|
31
31
|
|
32
|
-
def
|
32
|
+
def load_checkin_page(limit: 50, offset: 0, since: nil)
|
33
33
|
params = {
|
34
34
|
limit: limit,
|
35
35
|
offset: offset,
|
data/lib/chronicle/foursquare.rb
CHANGED
@@ -6,5 +6,5 @@ require_relative "foursquare/version"
|
|
6
6
|
require_relative "../omniauth/strategies/foursquare"
|
7
7
|
require_relative "foursquare/proxy"
|
8
8
|
require_relative "foursquare/authorizer"
|
9
|
-
require_relative "foursquare/
|
9
|
+
require_relative "foursquare/checkins_extractor"
|
10
10
|
require_relative "foursquare/checkin_transformer"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chronicle-foursquare
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Louis
|
@@ -112,9 +112,9 @@ files:
|
|
112
112
|
- lib/chronicle/foursquare.rb
|
113
113
|
- lib/chronicle/foursquare/authorizer.rb
|
114
114
|
- lib/chronicle/foursquare/checkin_transformer.rb
|
115
|
+
- lib/chronicle/foursquare/checkins_extractor.rb
|
115
116
|
- lib/chronicle/foursquare/proxy.rb
|
116
117
|
- lib/chronicle/foursquare/version.rb
|
117
|
-
- lib/chronicle/foursquare/visits_extractor.rb
|
118
118
|
- lib/omniauth/strategies/foursquare.rb
|
119
119
|
homepage: https://github.com/chronicle-app/chronicle-foursquare
|
120
120
|
licenses: []
|