Module: InstagramGraphApi::Client::Users
- Included in:
- InstagramGraphApi::Client
- Defined in:
- lib/instagram_graph_api/client/users.rb
Instance Method Summary collapse
- #connected_ig_accounts(fields = nil) ⇒ Object
- #get_account_info(ig_account_id, fields = nil) ⇒ Object
- #ig_business_accounts(fields = nil) ⇒ Object
Instance Method Details
#connected_ig_accounts(fields = nil) ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/instagram_graph_api/client/users.rb', line 12 def connected_ig_accounts(fields = nil) fields ||= 'id,name,biography,ig_id,followers_count,profile_picture_url,username' accounts = get_pages("?fields=connected_instagram_account{#{fields}}") accounts.map do |a| a["connected_instagram_account"].merge(page_id: a["id"]) if a["connected_instagram_account"] end.compact end |
#get_account_info(ig_account_id, fields = nil) ⇒ Object
20 21 22 23 |
# File 'lib/instagram_graph_api/client/users.rb', line 20 def get_account_info(ig_account_id, fields = nil) fields ||= "biography,followers_count,ig_id,name,profile_picture_url,username,id" get_connections(ig_account_id , "?fields=#{fields}") end |
#ig_business_accounts(fields = nil) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/instagram_graph_api/client/users.rb', line 4 def ig_business_accounts(fields = nil) fields ||= 'id,name,biography,ig_id,followers_count,profile_picture_url,username' accounts = get_pages("?fields=instagram_business_account{#{fields}}") accounts.map do |a| a["instagram_business_account"].merge(page_id: a["id"]) if a["instagram_business_account"] end.compact end |