Class: Instagramp::Publish
- Inherits:
-
Object
- Object
- Instagramp::Publish
- Defined in:
- lib/instagramp/publish.rb
Instance Attribute Summary collapse
-
#token ⇒ Object
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(config, token) ⇒ Publish
constructor
A new instance of Publish.
- #published_id ⇒ Object
Constructor Details
#initialize(config, token) ⇒ Publish
Returns a new instance of Publish.
6 7 8 9 |
# File 'lib/instagramp/publish.rb', line 6 def initialize(config, token) @config = config @token = token end |
Instance Attribute Details
#token ⇒ Object
Returns the value of attribute token.
5 6 7 |
# File 'lib/instagramp/publish.rb', line 5 def token @token end |
Instance Method Details
#published_id ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/instagramp/publish.rb', line 11 def published_id instagram_business_id = [] ids = Instagram::Post::Ids(@config, @token) ids.each do |id| account = HTTParty.get("https://graph.facebook.com/v11.0/#{id}?fields=instagram_business_account&access_token=#{@token}") if JSON.parse(account.body)["instagram_business_account"]["id"] instagram_business_id.push(JSON.parse(account.body)["instagram_business_account"]["id"]) end end instagram_business_id end |