Sha256: 87a1cc63f803f0e369f6ac9290f7bbf3b2f3e97d215f43883216a59e4a17100f

Contents?: true

Size: 503 Bytes

Versions: 3

Compression:

Stored size: 503 Bytes

Contents

class IdsPlease
  module Parsers
    class Vkontakte < IdsPlease::Parsers::Base

      MASK = /vk\.com|vkontakte|new\.vk\.com/i

      class << self
        def interact(links)
          links.map { |l| parse_link(l) }.compact
        end

        def parse_link(link)
          if link.path =~ /id|club|public/
            id = link.path.sub(/\A\/id|\A\/club|\A\/public/, '')
            id.split(/[\/\?#]/).first
          else
            super
          end
        end
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ids_please-2.3.0 lib/ids_please/parsers/vkontakte.rb
ids_please-2.2.5 lib/ids_please/parsers/vkontakte.rb
ids_please-2.2.4 lib/ids_please/parsers/vkontakte.rb