module FbParse

Constants

VERSION

Public Class Methods

get_id_embed(code) click to toggle source
# File lib/fb_parse.rb, line 4
def self.get_id_embed(code)
  url = URI.extract(code)[0]
  if url.include? '?fbid='
    self.get_id_photo_video(url)
  elsif url.include? 'activity'
    self.get_id_feed(url)
  elsif url.include? 'photos'
    self.get_id_photo_other(url)
  else
    self.get_id_status_link_checkin(url)
  end
end
get_id_feed(url) click to toggle source
# File lib/fb_parse.rb, line 37
def self.get_id_feed(url)
  @id = url.split('/').last.split('?').first
  return @id
end
get_id_photo_other(url) click to toggle source
# File lib/fb_parse.rb, line 42
def self.get_id_photo_other(url)
  @id = url.split('/')[6]
  return @id
end
get_id_photo_video(url) click to toggle source
# File lib/fb_parse.rb, line 32
def self.get_id_photo_video(url)
  @id = url.split('/')[3].split('=')[1].split('&')[0]
  return @id
end
get_id_url(url) click to toggle source
# File lib/fb_parse.rb, line 17
def self.get_id_url(url)
  if url.include? 'photo'
    self.get_id_photo_video(url)
  elsif url.include? 'activity'
    self.get_id_feed
  else
    self.get_id_status_link_checkin(url)
  end
end