Class: IdsPlease::Twitter

Inherits:
BaseParser show all
Defined in:
lib/ids_please/twitter.rb

Constant Summary collapse

MASK =
/twitter/i

Class Method Summary collapse

Methods inherited from BaseParser

network_name, parse

Class Method Details



5
6
7
8
9
10
11
12
# File 'lib/ids_please/twitter.rb', line 5

def self.parse_link(link)
  if link.path =~ /%23!/
    id = link.path.sub(/\A\/%23!\//, '')
    id.split(/[\/\?#]/).first
  else
    link.path.split('/')[1]
  end
end