instagram_graph_api 0.0.9 → 0.0.10

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: 9ce3c01bb2a61b0d67069ade5dbf910ad2d3b53e6c709cf62d983f83273f32e2
4
- data.tar.gz: d9a57ee385e8e8adb7ed0024a6bc6a055829ce73f6b0c0d706af6dc6212d8b12
3
+ metadata.gz: edf6e14621325335006372e2dc528258578999f3effd5a2c298f3742dab246ba
4
+ data.tar.gz: 6d20e67929d8899e3bfb99a3af7a60737f72ef07b2049a52c9b59b9ba8df00b8
5
5
  SHA512:
6
- metadata.gz: 6a60d72465fdd1dfe146111c072520a2d9bbe1acd9df8472566729a8e9115af7115755a8b61773386347dcebebf2141808c009ea04634ddf8e4da43d705e6d36
7
- data.tar.gz: 40522c038bd62a551d2bc83d8234eddd7e27cd7940c8c9d6489dd819be9ad6c6dc29a6794efbd6fcf75a39028d9d9d132316e38a3f15ac4c6fd6895497f8b55b
6
+ metadata.gz: 0ce67f9ed15721af55c677d2d93ad00eb589a22597a8d5c34aa77a480458ab7ae3df6f32829a79fea3847d898d6c4e47c6a8fcf6eea075d17920e58ce9422375
7
+ data.tar.gz: 9756deddc2671b2af5dc75f4009d184c020397852fbd0dd00ef179fef1c2c4a38acbd66d92ed6fb739a076e7ac82efa2d261e6feb9804199094715ad8e95408e
@@ -18,15 +18,16 @@ module InstagramGraphApi
18
18
  "timestamp,thumbnail_url"
19
19
  }
20
20
 
21
- def get_user_recent_media(id, type: "image", options: {})
21
+ def get_user_recent_media(id, fields = nil, type: "image", options: {})
22
22
  entity = type.eql?("story") ? "stories" : "media"
23
- query = "#{entity}?fields=#{MEDIA_INFO_HASH[type.to_sym]}"
23
+ fields ||= MEDIA_INFO_HASH[type.to_sym]
24
+ query = "#{entity}?fields=#{fields}"
24
25
  query += "&after=#{options[:after]}" if options[:after]
25
26
  query += "&before=#{options[:before]}" if options[:before]
26
27
  get_connections(id, query)
27
28
  end
28
29
 
29
- def get_media_details(media_id, type: "image")
30
+ def get_media_details(media_id, fields = nil, type: "image")
30
31
  fields ||= MEDIA_INFO_HASH[type.to_sym]
31
32
  get_connections(media_id , "?fields=#{fields}")
32
33
  end
@@ -9,6 +9,14 @@ module InstagramGraphApi
9
9
  end.compact
10
10
  end
11
11
 
12
+ def connected_ig_accounts(fields = nil)
13
+ fields ||= 'id,name,biography,ig_id,followers_count,profile_picture_url,username'
14
+ accounts = get_pages("?fields=connected_instagram_account{#{fields}}")
15
+ accounts.map do |a|
16
+ a["connected_instagram_account"].merge(page_id: a["id"]) if a["connected_instagram_account"]
17
+ end.compact
18
+ end
19
+
12
20
  def get_account_info(ig_account_id, fields = nil)
13
21
  fields ||= "biography,followers_count,ig_id,name,profile_picture_url,username,id"
14
22
  get_connections(ig_account_id , "?fields=#{fields}")
@@ -1,3 +1,3 @@
1
1
  module InstagramGraphApi
2
- VERSION = "0.0.9"
2
+ VERSION = "0.0.10"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: instagram_graph_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rakesh
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-02-12 00:00:00.000000000 Z
11
+ date: 2019-03-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler