lib/ids_please/facebook.rb in ids_please-1.0.0 vs lib/ids_please/facebook.rb in ids_please-1.0.1
- old
+ new
@@ -2,12 +2,13 @@
class 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')
+ query = CGI.parse(link.query) if link.query && !link.query.empty?
+
+ if query && query['id']
+ query['id'].first
elsif link.path =~ /\/pages\//
link.path.split('/').last
else
link.path.split('/')[1]
end