Sha256: decb1637c86cc8d94b418f9a1d7781f7d002bd0b803f0e6440fe13d63e01f8cf

Contents?: true

Size: 420 Bytes

Versions: 1

Compression:

Stored size: 420 Bytes

Contents

class IdsPlease
  class Facebook < IdsPlease::BaseParser

    MASK = /fb\.me|fb\.com|facebook/i

    private

    def self.parse_link(link)
      query = CGI.parse(link.query) if link.query && !link.query.empty?

      if query && !query['id'].empty?
        query['id'].first
      elsif link.path =~ /\/pages\//
        link.path.split('/').last
      else
        link.path.split('/')[1]
      end
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ids_please-1.1.0 lib/ids_please/facebook.rb