Sha256: bc2ef1eacaa3bec0256d8405da63adb57573626e15a46d329f1a8c3cbe76b299

Contents?: true

Size: 370 Bytes

Versions: 3

Compression:

Stored size: 370 Bytes

Contents

class IdsPlease::Facebook < IdsPlease::BaseParser

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

  def self.parse_link(link)
    if link.query && !link.query.empty?
      query = CGI.parse(link.query)
      query['id'].first if query.keys.include?('id')
    elsif link.path =~ /\/pages\//
      link.path.split('/').last
    else
      link.path.split('/')[1]
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ids_please-0.0.3 lib/ids_please/facebook.rb
ids_please-0.0.2 lib/ids_please/facebook.rb
ids_please-0.0.1 lib/ids_please/facebook.rb