Sha256: 5453c10c88825e949d46bb684609ede88a834ae4b5bcbb544625b0d37ab35d11

Contents?: true

Size: 783 Bytes

Versions: 2

Compression:

Stored size: 783 Bytes

Contents

module OEmbed
  class Providers
    # Provider for Facebook posts
    class FacebookPost < OEmbed::Provider
      def initialize(access_token:)
        super("https://graph.facebook.com/v8.0/oembed_post?access_token=#{access_token}", :json)
        register_urls!
      end

      private

      def register_urls!
        ['https://www.facebook.com/*/posts/*',
         'https://www.facebook.com/*/activity/*',
         'https://www.facebook.com/photo*',
         'https://www.facebook.com/photos*',
         'https://www.facebook.com/*/photos*',
         'https://www.facebook.com/permalink*',
         'https://www.facebook.com/media*',
         'https://www.facebook.com/questions*',
         'https://www.facebook.com/notes*'].each { |u| self << u }
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-oembed-0.14.1 lib/oembed/providers/facebook_post.rb
ruby-oembed-0.14.0 lib/oembed/providers/facebook_post.rb