Class: Instagramp::Publish

Inherits:
Object
  • Object
show all
Defined in:
lib/instagramp/publish.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#tokenObject

Returns the value of attribute token.



5
6
7
# File 'lib/instagramp/publish.rb', line 5

def token
  @token
end

Instance Method Details

#published_idObject



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|
     = HTTParty.get("https://graph.facebook.com/v11.0/#{id}?fields=instagram_business_account&access_token=#{@token}")
    if JSON.parse(.body)["instagram_business_account"]["id"]
      instagram_business_id.push(JSON.parse(.body)["instagram_business_account"]["id"])
    end
  end
  instagram_business_id
end