zelf-sdk 1.1.0 → 1.1.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/zelf/models.rb +2 -2
- data/lib/zelf/resources/analytics.rb +10 -10
- data/lib/zelf/resources/brand_accounts.rb +3 -3
- data/lib/zelf/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7dc5aa63857c8d396bdcbfa9cd168c29835cfa5f5944e45d112a9421a508bb4f
|
|
4
|
+
data.tar.gz: 72f2a544049cf5fad0c50ba0c32a4644dfbc03e9b39c73285602e3a91bbb8ec5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ad309f547e96a6b246dd6916343330f8e320438384798a1989318f3348cae191e74297b07b94aa4be82fe4c61097c61b99e43e667c6d3408e87192a9f8093b9
|
|
7
|
+
data.tar.gz: 571827d98e57f10d16dc9db5f41573514e7f432c625dce9f9a5730efb6c5a95e01c40ddf7b0a5c026e1171357e50dfccbfe4f1d507cace85b2e387e9e7db5195
|
data/lib/zelf/models.rb
CHANGED
|
@@ -487,10 +487,10 @@ module Zelf
|
|
|
487
487
|
field :transcript, "transcript"
|
|
488
488
|
# Direct URL to the post on its platform
|
|
489
489
|
field :platform_url, "platform_url"
|
|
490
|
-
# Short AI-generated summary of the content
|
|
491
|
-
field :ai_summary, "ai_summary"
|
|
492
490
|
# The search term the content was most recently found by
|
|
493
491
|
field :last_keyword, "last_keyword"
|
|
492
|
+
# Short AI-generated summary of the content
|
|
493
|
+
field :ai_summary, "ai_summary"
|
|
494
494
|
# Hashtags used in the post, normalized to lowercase and without the leading #
|
|
495
495
|
field :hashtags, "hashtags"
|
|
496
496
|
end
|
|
@@ -8,10 +8,10 @@ module Zelf
|
|
|
8
8
|
end
|
|
9
9
|
|
|
10
10
|
# Compare Brand Performance. Returns one row of totals per brand: the top-level brand
|
|
11
|
-
# named by `brand_id
|
|
12
|
-
#
|
|
13
|
-
#
|
|
14
|
-
# instead.
|
|
11
|
+
# named by `brand_id` first, then each of its competitor sub-brands by title. Theme
|
|
12
|
+
# sub-brands are not competitors and are left out. The statistics block matches
|
|
13
|
+
# `content.statistics`, so the same parsing works for both. `brand_id` must name a
|
|
14
|
+
# top-level brand. A sub-brand is refused with the id of the parent to use instead.
|
|
15
15
|
#
|
|
16
16
|
# Calls GET /api/v1/analytics/brand_comparison/ (analytics.brand_comparison).
|
|
17
17
|
def brand_comparison(brand_id:, platform: nil, posted_after: nil, posted_before: nil, posted_within_days: nil, posted_within_hours: nil)
|
|
@@ -24,14 +24,14 @@ module Zelf
|
|
|
24
24
|
"posted_within_hours" => posted_within_hours,
|
|
25
25
|
}.reject { |_, value| value.nil? }
|
|
26
26
|
envelope = @transport.request(:get, "/api/v1/analytics/brand_comparison/", query: query)
|
|
27
|
-
Zelf.
|
|
27
|
+
Zelf.rows(envelope, Models::BrandComparison)
|
|
28
28
|
end
|
|
29
29
|
|
|
30
30
|
# Get Brand Follower Time Series. Returns follower history for the top-level brand
|
|
31
|
-
# named by `brand_id`
|
|
32
|
-
# brand appears only for the periods in which one of its owned handles
|
|
33
|
-
# Follower counts carry forward: a handle with no reading in a period
|
|
34
|
-
# one recorded before it.
|
|
31
|
+
# named by `brand_id` first, then each of its competitor sub-brands by title, bucketed
|
|
32
|
+
# by `period`. A brand appears only for the periods in which one of its owned handles
|
|
33
|
+
# was measured. Follower counts carry forward: a handle with no reading in a period
|
|
34
|
+
# keeps the last one recorded before it.
|
|
35
35
|
#
|
|
36
36
|
# Calls GET /api/v1/analytics/follower_timeseries/ (analytics.follower_timeseries).
|
|
37
37
|
def follower_timeseries(brand_id:, period: nil, platform: nil, posted_after: nil, posted_before: nil, posted_within_days: nil, posted_within_hours: nil)
|
|
@@ -45,7 +45,7 @@ module Zelf
|
|
|
45
45
|
"posted_within_hours" => posted_within_hours,
|
|
46
46
|
}.reject { |_, value| value.nil? }
|
|
47
47
|
envelope = @transport.request(:get, "/api/v1/analytics/follower_timeseries/", query: query)
|
|
48
|
-
Zelf.
|
|
48
|
+
Zelf.rows(envelope, Models::FollowerTimeseries)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
# Get Posted Comment Analytics. Returns the comments the brand posted in the window,
|
|
@@ -23,7 +23,7 @@ module Zelf
|
|
|
23
23
|
"brand_id" => brand_id,
|
|
24
24
|
}.reject { |_, value| value.nil? }
|
|
25
25
|
envelope = @transport.request(:post, "/api/v1/brands/accounts/", body: body)
|
|
26
|
-
Zelf.
|
|
26
|
+
Zelf.one(envelope, Models::BrandAccountGroups, "BrandAccountGroups")
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
# List Brand Accounts. Returns a brand's tracked and influencer creator accounts, plus
|
|
@@ -39,7 +39,7 @@ module Zelf
|
|
|
39
39
|
"brand_id" => brand_id,
|
|
40
40
|
}.reject { |_, value| value.nil? }
|
|
41
41
|
envelope = @transport.request(:get, "/api/v1/brands/accounts/", query: query)
|
|
42
|
-
Zelf.
|
|
42
|
+
Zelf.one(envelope, Models::BrandAccountGroups, "BrandAccountGroups")
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
# Remove Brand Accounts. Removes profiles from a brand's `tracked`, `influencer` or
|
|
@@ -58,7 +58,7 @@ module Zelf
|
|
|
58
58
|
"brand_id" => brand_id,
|
|
59
59
|
}.reject { |_, value| value.nil? }
|
|
60
60
|
envelope = @transport.request(:delete, "/api/v1/brands/accounts/", body: body)
|
|
61
|
-
Zelf.
|
|
61
|
+
Zelf.one(envelope, Models::BrandAccountGroups, "BrandAccountGroups")
|
|
62
62
|
end
|
|
63
63
|
end
|
|
64
64
|
end
|
data/lib/zelf/version.rb
CHANGED