Class: IdsPlease::Parsers::Facebook
- Defined in:
- lib/ids_please/parsers/facebook.rb
Constant Summary collapse
- MASK =
/fb\.me|fb\.com|facebook/i
Class Method Summary collapse
Methods inherited from Base
interact, to_sym, valid_id_regex
Class Method Details
.parse_link(link) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/ids_please/parsers/facebook.rb', line 8 def 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 |