bundl_instagram_api 1.0.4 → 1.0.8

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: 2fdf3a30289edc61b01af3ec80ce1b530e773d63d37cddf5f17887f93693c01b
4
- data.tar.gz: 9f9fda66f1754a814bc6839a8b9e6698521bad101197686a505454d22923ff1b
3
+ metadata.gz: dd9629326eee966b1f18e01907a8bacd9992fd827eb145343db64cc5daedc1b9
4
+ data.tar.gz: 450b8ad935cf6509de608ce9ba8e8356f4bdc5eec01bda4ed1837a8769bd6088
5
5
  SHA512:
6
- metadata.gz: f4055e3cdb68bcbede7e84e200176cbbce23846b5724bae2fd29b96d10002d1c662819d8fd2642d284980339628acb0b566c9f6b09339626ee473b5624dd267e
7
- data.tar.gz: a153a73eb311b4035287bfa13d57bdc4526f109d3081f508618428b1b39d882042b45ad4f7c01f470879532b0f6ba67290be25ff119d40f59cdb7824233c57c2
6
+ metadata.gz: f0103014fe2891e1caecd4af47ca9941155446cb8c9264e334161caca6358b21afe849492842d93900117738b7db6f9fab00477ea3a93b1fa9a388a83ff2b82a
7
+ data.tar.gz: 4c4e655b82a58646bd5256d0929626d656477f74b3abf7360e34f6520f9a181edbe2f8250709a023547c5b52473b6c4949166754a8dfbf3df7539aeb35ae5e82
@@ -17,10 +17,10 @@ module BundlInstagramApi
17
17
  end
18
18
  end
19
19
 
20
- def user_insights(object_id, metrics: nil, period:nil, since:nil, until:nil)
21
- @raw_insights = get_connections(object_id, "insights?metric=#{metrics}&period=#{period}")
20
+ def user_insights(object_id, metrics: nil, period:nil, since:nil, to:nil)
21
+ @raw_insights = get_connections(object_id, "insights?metric=#{metrics}&period=#{period}&since=#{since}&until=#{to}")
22
22
  @raw_insights.reduce({}) do |result, insight_data|
23
- result[insight_data["name"]] = insight_data["values"].first["value"]
23
+ result[insight_data["name"]] = insight_data["values"]
24
24
  result
25
25
  end
26
26
  end
@@ -12,10 +12,10 @@ module BundlInstagramApi
12
12
  "timestamp,thumbnail_url"
13
13
  }
14
14
 
15
- def get_user_recent_media(id, fields = nil, type: "image", options: {})
15
+ def get_user_recent_media(id, fields = nil, type: "image", limit = nil, options: {})
16
16
  entity = type.eql?("story") ? "stories" : "media"
17
17
  fields ||= MEDIA_INFO_HASH[type.to_sym]
18
- query = "#{entity}?fields=#{fields}"
18
+ query = "#{entity}?limit=#{limit}&fields=#{fields}"
19
19
  query += "&after=#{options[:after]}" if options[:after]
20
20
  query += "&before=#{options[:before]}" if options[:before]
21
21
  get_connections(id, query)
@@ -26,6 +26,11 @@ module BundlInstagramApi
26
26
  get_connections(media_id , "?fields=#{fields}")
27
27
  end
28
28
 
29
+ def get_comments(media_id, fields = nil)
30
+ fields ||= MEDIA_INFO_HASH[type.to_sym]
31
+ get_connections(media_id , "/comments?fields=#{fields}")
32
+ end
33
+
29
34
  end
30
35
  end
31
36
  end
@@ -1,3 +1,3 @@
1
1
  module BundlInstagramApi
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bundl_instagram_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tyler
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-17 00:00:00.000000000 Z
11
+ date: 2021-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler