bundl_instagram_api 1.0.5 → 1.0.9

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: 0d12399fcd29530db247862052fbcf8f154c2d4bb452dec671b470d874f1bca1
4
- data.tar.gz: 939a106f68965b453d11a3ada50789a1182cfcb2223630349ea04ff145e527bd
3
+ metadata.gz: f282618cc87d06df6d7ce77137e0fe5054d8b6eb3e8e08cf8b0dffad2873099f
4
+ data.tar.gz: ef5917ae72c1e293687d424900ec6ed09dbc308313b2e806540ca0270bcde8d3
5
5
  SHA512:
6
- metadata.gz: 648dcd7920df5fda06574acaa2bf6721ba0eb690d632cf64b503cad684820ad707af666758521c8b245b64466275576a44198d64f379e9799f63ee243388cbe5
7
- data.tar.gz: ba48f2f0adbfa5df827b4aae5675e0db10f809e5db5724084d37a8ba97651dd5aea703d5a7ebb6b7bf756527ec1936487db562b9bd59d21bfd04a5bba1bf4113
6
+ metadata.gz: 3aa285c45975c9dd76f02174cb009af10a62b29fd6ecf87d4607653f04ca491cac726928c54e4d82bed0866243861750724c9dabb5b38031409dd24e63b87499
7
+ data.tar.gz: 32cc3c074176a6b2efbb12f851411a79e33ece52c4698c6a2ea45884936530d7a9ce21eb45fc9dadefb1ca65fd1d39d3cf1909cc5ab2e4bdca6d33febcdc1d94
@@ -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}&since=#{since}&until=#{until}")
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.5"
2
+ VERSION = "1.0.9"
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.5
4
+ version: 1.0.9
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